You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.
Some middleware modules are used on every backend project because they provide key functionality to the HTTP layer, namely:
koa-compress
koa-bodyparser
kcors
koa-conditional-get & koa-etag
koa-helmet
koa-static
koa-router
Authorization header parser (JWT, mostly)
Error handler (catches errors thrown in middleware, logs them and sends a 5xx response back)
Generic logger to log all incoming requests/responses
I think we could wrap most (if not all) of these modules into a single module so that consumers do not need to install and configure all of these manually.
Implementation requirements:
Sensible defaults must be provided for all middleware
Consumers must be able to disable or even replace any of them if they so choose, without affecting the other modules. Preferrably, the ordering of modules, especially when mixing these "built-in" middleware with user-defined middleware should be somehow configurable.
Everything must be fully configurable
Only what is generally considered a "standard" or "best practice" for REST APIs should be included (ie. do not enable clickjacking protection - we do not serve HTML so we do not need to enable this kind of protection)
The text was updated successfully, but these errors were encountered:
Some middleware modules are used on every backend project because they provide key functionality to the HTTP layer, namely:
Authorization
header parser (JWT, mostly)I think we could wrap most (if not all) of these modules into a single module so that consumers do not need to install and configure all of these manually.
Implementation requirements:
The text was updated successfully, but these errors were encountered: