Skip to content

🚀 [v3 Feature]: Interchangeable router with contribution packages #2202

@ReneWerner87

Description

@ReneWerner87

Feature Description

🗣️ through user feedback we have learned that the syntax and behavior of route registration and expiration is a much discussed topic

depending on which frameworks/programming languages the developers have had good experiences with, they want syntax and behavior that is close to what they know and have had positive experiences with.

💡the idea

is to address the problem by creating the possibility to use different router syntax and/or behavior via contribution packages

with this it should be possible to use different concepts of route registration syntax like a laravel router or other routers like a radix tree router, which has a completely different behavior when processing the routes.

🔢 steps necessary to make it possible

  • a router interface must be created that includes the api's that the framework needs to run
  • all api's of the framework which are needed by the router have to be prepared for the expose to the outside (please design in a way that
    there are no major changes are expected in the future, so that backwards compatibility is always given)

📒 Sidenote:

  • the express router is the only one included in the core package, which also corresponds to the interface of the other routers.
  • this is used as default without thw need of any user configuration

❔ Not yet defined

  • the way the router will be registered is not yet clear
  • will prepare some proposals/examples
  • it is also unclear whether the app in the first level can still be used directly for routing or should always be called app.Router()

Related issues
#2190
#2200
#1829

Code Snippet (optional)

package main

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

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

  // An example to describe the feature

  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

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions