Middlewares
You can configure express middleware or add custom middleware by adding configuration files to the middlewares folder.
Global Middlewares#
The middlewares configuration file is called after the environment files loaded.
The middlewares will be used on all requests.
config/middlewares/all.ts
This middleware will be added only when the env is production
config/middlewares/production.ts
Async middlewares#
Async middlewares also supported.
if error is thrown next(new HttpError(e)) is called