Skip to content

Option for a more express-like routing API #16

@danvk

Description

@danvk

Normally with Express, the router API looks like this:

router.post('/path/:param', (request, response) => {
  const {params, body} = request;
  // ...
});

The crosswalk equivalent looks like:

typedRouter.post('/path/:param', (params, body, request, response) => {
  // ...
});

There's no reason crosswalk couldn't provide an equivalent of the express post that just takes request and response params but types their body & params properties. This might make migration simpler and would remove some awkwardness when you want the request param but don't have path params or a body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions