routux

0.3.0 • Public • Published

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://cdn.rawgit.com/Nicolab/routux/master/dist/routux.min.js"></script>

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

<script src="https://cdn.rawgit.com/Nicolab/routux/v0.3.0/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

Readme

Keywords

Package Sidebar

Install

npm i routux

Weekly Downloads

11

Version

0.3.0

License

MIT

Unpacked Size

88.4 kB

Total Files

11

Last publish

Collaborators

  • nicolab