Skip to content

How to use colon as normal character instead of route param #3857

@isayme

Description

@isayme

Colon(:) used to define route param in Express/Koa.

app.get('/users/:userId/books/:bookId', function (req, res) {
  res.send(req.params)
})

Google API design use colon as custom verb
image

Question: Is there a way to define a route in which I want use colon as normal character ?

Target: define a route that match PUT /tasks/1234:undelete, and define with string instead of regexp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions