restyped-express-async
restyped-express-async copied to clipboard
express.js-based library for serving up RESTyped routes using promises
I have situation like this: ``` // fileA.ts const router = RestypedRouter(app); configureRouter(router); // fileB.ts function configureRouter(router: any) { //
So that one e.g. can write: ``` function firstMiddleware(req, res, next) {} function secondMiddleware(req, res, next) {} router.get( '/permissions', (req, res) => { return Promise.resolve().then(() => { return { managers:...
This may be an appropriate fix for the spec as a whole, but HTTP Headers are not included in TypedRequest. This can make handling authentication difficult as the types don't...
Lets say you have two routes: 1. `/login` 2. `/createItem` I want to validate the body of these requests with middleware which can be easily done yourself. The middleware is...
Hi, I am doing some small tests using restyped. I noticed that params and query can be typed with different types than strings. In a handler both query and params...
Nesting
Cool project, thanks a lot for doing this! I'm considering using this in http://voice.mozilla.org (https://github.com/mozilla/voice-web). Currently we nest our routers e.g. ```javascript app.use('/api', api.getRouter()); api.getRouter = () =>{ const router...