Middleware
Middleware functions allow you to run code before and after your route handlers. GraceJS supports both before-route and after-route middleware.
Before-Route Middleware
Before-route middleware can perform tasks such as authentication, request logging, and setting common headers.
After-Route Middleware
Similarly, after-route middleware is useful for tasks like logging responses or setting response headers.
Last updated