Middlewares
Overview
code.store platform support middleware functions for REST endpoints. To avoid manual file creation allowed a command cs generate:middleware
, which generate a template of middleware with handler method.
To generate middleware for your route just execute cs generate:middleware
CLI command, select one of middleware type: request or response middleware type, specify name for your function and select route from the route list:
After command execution will be generated file permissions.middleware.ts
in src/rest-middlewares
directory:
More information about handler method and his params can be found in REST section.
Last updated
Was this helpful?