import pathToRegex from 'u-http-server/util/pathToRegex';
> pathToRegex('/prefix/:category/:page') { regex: '^\/prefix\/([^/]+)\/([^/]+)$', keyToIndex: {category: 1, page: 2} }
this function transform a /path/:id into a regex (and map for index group to index name)
/path/:id
Generated using TypeDoc
import pathToRegex from 'u-http-server/util/pathToRegex';
> pathToRegex('/prefix/:category/:page') { regex: '^\/prefix\/([^/]+)\/([^/]+)$', keyToIndex: {category: 1, page: 2} }