1.0.3 • Published 5 years ago
fast-routes v1.0.3
Fast Routes
Javascript routing for single page applications.
Installing
yarn add fast-routes
npm install fast-routes
Usage
import {Router} from 'fast-routes';
// create router with parameter root url
const router = new Router('/');
// add some route that have url name and function
router.add('home', 'homePage', () => {
console.log('home route');
});
// listen for routing
router.listen();
<!-- You must add 'fast-route' class for routing -->
<a href='homePage' class='fast-route'> Home </a>
<a href='contactPage' class='fast-route'> Contact </a>
Also see full express app example that uses fast-routes.
Built With
- Typescript - Javascript that scales.
Authors
- Hasan Genc - linkedIn
License
This project is licensed under the MIT License - see the LICENSE file for details.