Skip to content

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.

NameDescription
assetsServe static files from a directory
basicBundle of body, cookie, and query plugins
bodyRead and parse the request body
cookieRead/write cookies
decoratorsClass, method, and parameter decorators
prometheusCollect and serve Prometheus metrics
queryParse URL query strings
rate-limitRate limit incoming requests
rate-limit-redisRedis adapter for rate-limit
swaggerServe Swagger/OpenAPI docs