6min

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.

What is middleware?

The purpose of middleware is to extend the hyper63 interface to support opinionated features without having to modify the core interface.

Middleware Examples

  • Authentication - you can choose the authentication pattern, we recommend JWT with hcma algorithm. Here is an example of some jwt middleware.

๏ปฟ

JS
|
  • Throttling
  • Adding additional routes for other services, like email, etc

Applying middleware

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.

JS
|

Need specific help? you can always reach out to our support team for any additional assistance at checkout our help desk๏ปฟ

๏ปฟ

Updated 19 May 2021
Did this page help?
Yes
No