ForbesLindesay / express-route-tester

Attempts to give you an idea of what urls will be accepted by an express route (please fork and extend it)

Home Page:http://forbeslindesay.github.com/express-route-tester/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

it don't work

Sequoia opened this issue Β· comments

route: /admin
path: /admin/foo

  • Expected: βœ…
  • Actual: ❌ πŸ‘ˆ incorrect

route: /admin/*
path: /admin/foo

  • Expected: βœ…
  • Actual: ❌ πŸ‘ˆ incorrect

Etc.

So although this is called "express-route-tester" it should actually be called "path-to-regexp" tester (https://www.npmjs.com/package/path-to-regexp). Express uses "path-to-regexp", but at a very old version (0.1.7), which has different behaviour for *.

Unfortunately Express' documentation says to use this tool, which has been updated. Ideally the tool could have a switch to choose the old or new dialect - there is a PR that does this (#11) and you can use it here: https://wesleytodd.github.io/express-route-tester/

This is now fixed