diff --git a/packages/custom.go b/packages/custom.go index e5f5d5d..a99da46 100644 --- a/packages/custom.go +++ b/packages/custom.go @@ -12,10 +12,11 @@ var CustomReplacer = map[string]string{ } func RegisterCustom(app *fiber.App) { - for _, v := range CustomReplacer { - app.All(fmt.Sprintf("/%s/*", v), func(c *fiber.Ctx) error { - source := strings.TrimPrefix(c.Path(), fmt.Sprintf("/%s", v)) + for k, v := range CustomReplacer { + app.All(fmt.Sprintf("/%s/*", k), func(c *fiber.Ctx) error { + source := strings.TrimPrefix(c.Path(), fmt.Sprintf("/%s", k)) uri := fmt.Sprintf("%s%s", v, source) + fmt.Println(uri) resp, err := utils.Get(uri, nil) if err != nil { return Catch(c, err)