Skip to content

v3.1.0

Compare
Choose a tag to compare
@lukeed lukeed released this 11 Jul 05:08

Features

  • Support RegExp route patterns: (#11): af37967

    You may use named capture groups, which will automatically set req.params values.
    However, they're only supported in Node 10.x and above~!

    Checkout the new documentation from regexparam for more details.

    app.get(/^\/posts[/](?<year>[0-9]{4})[/](?<month>[0-9]{2})[/](?<title>[^\/]+)/i, (req, res) => {
      console.log(req.params.year); //=> '2019'
      console.log(req.params.month); //=> '05'
      console.log(req.params.title); //=> 'hello-world'
    });
    
    app.find('GET', '/posts/2019/05/hello-world');

    Thank you @jirutka for instigating and working on this feature!

Chores

  • Remove & hide package-lock.json file: 3671881
  • Pin versions for devDependency modules: b87fd7b