Middleware
Middleware is a function that injects the app instance as a parameters and the function should return the app instance to the calling function. To create a chain-able collection of middleware.
The purpose of middleware is to extend the hyper63 interface to support opinionated features without having to modify the core interface.
- Authentication - you can choose the authentication pattern, we recommend JWT with hcma algorithm. Here is an example of some jwt middleware.
- Throttling
- Adding additional routes for other services, like email, etc
Once you created your middleware, you will want to apply it to hyper63 ⚡
In your hyper63.config.js file you will add a property on the config object called middleware, then you would include your middleware in an array, since it is a chain-able function you can add multiple middlewares in the array.
Need specific help? you can always reach out to our support team for any additional assistance at checkout our help desk