An open API service indexing awesome lists of open source software.

https://github.com/appleple/a-dispatcher

Just a simple url-dispatcher you can use with regex
https://github.com/appleple/a-dispatcher

es6 npm

Last synced: 11 months ago
JSON representation

Just a simple url-dispatcher you can use with regex

Awesome Lists containing this project

README

          

# a-dispatcher

Just a simple url-dispatcher you can use with regex

```sh
npm install a-dispatcher --save
```

```js
import Dispatcher from 'a-dispatcher';
import User from './user-info';
import Edit from './user-info';

const dispatcher = new Dispatcher();

dispatcher.addRoute('^/user', User);

dispatcher.addRoute('^/edit', Edit);

dispatcher.run(location.pathname);
```