Skip to content

🚀 [Feature]: Route Domain() func #2620

@kadirgun

Description

@kadirgun

Feature Description

In projects using multiple domains, the easy-to-use Domain() function can be added.

Additional Context (optional)

I know there are manual solutions, but they are not easy to use.

Code Snippet (optional)

package main

import "github.com/gofiber/fiber/v2"
import "log"

func main() {
  app := fiber.New()

  app.Domain(":username.blog.example.com").Get("/*path", func(c *fiber.Ctx) error {
    username := c.Params("username")
    return c.SendString(username + "'s blog page")
  })

  log.Fatal(app.Listen(":3000"))
}

Checklist:

  • I agree to follow Fiber's Code of Conduct.
  • I have checked for existing issues that describe my suggestion prior to opening this one.
  • I understand that improperly formatted feature requests may be closed without explanation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions