website logo
⌘K
Introduction
Getting started
πŸ“Reference
Data API
Cache API
Search API
Storage API
Queue API
Crawler API
πŸ”‘Authentication
βœ”οΈConfiguration
⚑Contributing to hyper
πŸ”ŒBuilding your own adapter
Code of Conduct
hyper RFCs
Style Guide
Bugs
Before Submitting A Bug Report
Building your own plugin
API Clients
Build your own client πŸ› οΈ
hyper connect
NodeJS Client πŸš€
Deno Client πŸ¦•
Middleware
Hooks
🚒Deploy
Deploy hyper on Render
Deploy hyper on AWS
Deploy hyper on Digital Ocean
Deploy hyper on Google Cloud
Deploy hyper on Azure
πŸ“œChangelog
FAQ
πŸ“•Terminology
Parameters
What is REST?
What is JSON?
πŸ“˜Glossary
Docs powered byΒ archbeeΒ 
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 you?
Yes
No
UP NEXT
Hooks
Docs powered byΒ archbeeΒ 
TABLE OF CONTENTS
What is middleware?
Middleware Examples
Applying middleware