Skip to content
A fast and productive router to improve the UX (User eXperience) of any front-end application (supports middlewares, regex pattern, named routes, error handler, ...).
JavaScript HTML
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist [dist] v0.3.0 Feb 8, 2018
doc Update the links of the documentation Aug 2, 2015
examples Update the links of the documentation Aug 2, 2015
src [umd] better exposes Feb 8, 2018
tasks [tasks] update loaders presets Feb 8, 2018
test Fix common JS build Oct 17, 2015
.gitignore Update the links of the documentation Aug 2, 2015
.jshintrc Initial commit Aug 2, 2015
.npmignore Reduce package size Aug 2, 2015
LICENSE Update the date Mar 1, 2016
README.md [README] update CDN URLs Feb 8, 2018
gulpfile.babel.js Initial commit Aug 2, 2015
package.json [package] v0.3.0 / up deps Feb 8, 2018

README.md

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
You can’t perform that action at this time.