Routing

Routing refers to determining how an application responds to a client request for a given endpoint, which is a URI (or path) and a specific HTTP request method (GET, PUT, POST, and so on).

Each route can have multiple handlers, which are executed when the route is called.


// Function signature
q.Method(path string, ...func(*quick.Ctx) error)
                        
  • 'q' is an instance of Quick
  • 'Method' is an HTTP request method
  • 'path' is the virtual path on the server
  • 'func(*quick.Ctx) error' is a callback function containing the Context of the call

When using a path containing URL parameters, use the c.Params function to retrieve them.

For more information about Routing in Fiber, click here

routing.go