middleware-only-at-path
Lets you use an Express middleware, only at a specific path.
Useful as app.use(onlyAt('/', middleware))
so it doesn't run the middleware any deeper than
exactly /
.
This means you don't have to write the routes in a backwards order for the middlewares to take effect only where you want them.
Install
npm install --save middleware-only-at-path
Example
If you want to use allow-methods at specific paths, you can do this:
;;; const app = ; app;app; app;app; app;