frontexpress-path-to-regexp
v1.0.0
Published
[Frontexpress](https://github.com/camelaissani/frontexpress) plugin to support Express-style path string such as /user/:name.
Downloads
5
Maintainers
Readme
frontexpress-path-to-regexp
Frontexpress plugin to support Express-style path string such as /user/:name.
Installation
npm install frontexpress-path-to-regexp --save
Usage
import frontexpress from 'frontexpress';
import pathToRegexp from 'frontexpress-path-to-regexp';
// Front-end application
const app = frontexpress();
app.use(pathToRegexp);
// now all express-style path are supported :)
app.get('/:foo*', (req, res) => {
document.querySelector('.content').innerHTML = res.responseText;
});
This plugin uses path-to-regexp for matching the route paths; see the path-to-regexp documentation for all the possibilities in defining route paths.