Plugins
Routup is minimalistic by design. Plugins extend the framework with additional functionality that is not part of the core.
A plugin is an object with a name and an install method that receives the router instance.
Mounting
Mount a plugin globally:
typescript
router.use(myPlugin({ /* options */ }));Mount a plugin on a specific path:
typescript
router.use('/api', myPlugin({ /* options */ }));Writing a Plugin
For the full plugin authoring contract — interface, dependencies, version constraints, and conventions — see the Plugin Authoring guide.
Ecosystem
Official plugins are available at GitHub.
| Name | Description |
|---|---|
| assets | Serve static files from a directory |
| basic | Bundle of body, cookie, and query plugins |
| body | Read and parse the request body |
| cookie | Read/write cookies |
| decorators | Class, method, and parameter decorators |
| prometheus | Collect and serve Prometheus metrics |
| query | Parse URL query strings |
| rate-limit | Rate limit incoming requests |
| rate-limit-redis | Redis adapter for rate-limit |
| swagger | Serve Swagger/OpenAPI docs |