crosswalk
crosswalk copied to clipboard
Typed express router for TypeScript
crosswalk validates request bodies, but it might also be useful to validate response bodies. This could catch errors due to `as any` and other type assertions. And if you use...
Normally with Express, the router API looks like this: ```ts router.post('/path/:param', (request, response) => { const {params, body} = request; // ... }); ``` The crosswalk equivalent looks like: ```ts...
Express paths can include optional parameters, e.g. `/users/:userId/posts/:postId?`. This should be modeled in the types. See https://expressjs.com/en/guide/routing.html#route-paths https://twitter.com/ryanastelly/status/1301883392116633604 I'm quite confident I read a blog post about doing this, but...
as we generated a spec w/ `const` and it passed the 3.1.0 validator but not the 3.0.0 validator. ``` Test Suites: 4 passed, 4 total Tests: 28 passed, 28 total...