Skip to content
/ routux Public

A fast and productive router to improve the UX (User eXperience) of any front-end application (supports middlewares, regex pattern, named routes, error handler, ...).

License

Notifications You must be signed in to change notification settings

Nicolab/routux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Routux

A fast and productive router to improve the UX (User eXperience) of any frontend application. Inspired by the router of Express JS (amongst others), Routux supports:

  • middlewares,
  • Regex pattern,
  • named route,
  • route reverse,
  • asynchronicity,
  • error handler,
  • ... and others useful features.

Getting started

Install from NPM

Terminal:

npm install routux --save

JS:

var routux = require('routux');
var router = new routux.Router();

router.use('/', function(req, next) {
  // Your logic here
});

router.run();

Or install from source file

Download dist/routux.min.js file and add in your HTML file:

<script src="./path-of-your-js-files/routux.min.js"></script>

Then routux is in the global scope:

var router = new routux.Router();

router.use('/', function(req, next) {
  // Your logic here
});

router.run();

Use CDN

<script src="https://rawgit.com/Nicolab/routux/master/dist/routux.min.js"></script>

You can change master by a specific commit hash.
Example for v0.3.0:

<script src="https://cdn.rawgit.com/Nicolab/routux/e43f70c2/dist/routux.min.js"></script>

Note: please, use the latest version

Usage

See the doc and the examples directory.

Development of Routux core

Routux is developped in ES6 (EcmaScript6) in src directory and compiled to ES5 in the dist/routux.min.js file.

Build a minified distributable, in the terminal:

gulp dist.build

Develop with the automatic rebuilds (the distributable and the unit tests):

gulp testing

Unit tests

Routux is unit tested with Unit.js, Mocha and Webdriver.io.

TODO: There are still things to test.

LICENSE

MIT (c) 2016, Nicolas Tallefourtane.

Author

Routux is designed and built with love by

Nicolas Tallefourtane - Nicolab.net
Nicolas Talle
Make a donation via Paypal

About

A fast and productive router to improve the UX (User eXperience) of any front-end application (supports middlewares, regex pattern, named routes, error handler, ...).

Resources

License

Stars

Watchers

Forks

Packages

No packages published