Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/franciscop/loadware
Make sense of a bunch of middleware definitions and return an array of middleware
https://github.com/franciscop/loadware
Last synced: 13 days ago
JSON representation
Make sense of a bunch of middleware definitions and return an array of middleware
- Host: GitHub
- URL: https://github.com/franciscop/loadware
- Owner: franciscop
- License: mit
- Created: 2016-12-09T05:31:32.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-24T10:04:18.000Z (almost 8 years ago)
- Last Synced: 2024-04-26T04:04:40.217Z (7 months ago)
- Language: JavaScript
- Size: 7.81 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# loadware
Make sense of a bunch of middleware definitions and return an array of middleware:
```js
const loadware = require('loadware');let router = require('express').Router();
router.get('/', (req, res) => { res.send('Hello there'); });let middlewares = loadware(
'body-parser',
(req, res, next) => { next(); },
'./middle/whatever.js',
router
);
```The middleware can be a string, a function or an array of any of the previous.
This is part of another project which is WIP right now, but I think this is independently enough so it can be launched separately.