├── .gitignore ├── .jshintrc ├── .travis.yml ├── LICENSE.md ├── README.md ├── bower.json ├── lib └── router-base.js ├── package.json └── test ├── data ├── generate-data.js ├── getRouteInfo-data.js ├── match-data.js └── routes.js └── router-base.test.js /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | node_modules 3 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "bitwise": true, 3 | "curly": true, 4 | "eqeqeq": true, 5 | "forin": true, 6 | "freeze": true, 7 | "immed": true, 8 | "newcap": true, 9 | "noarg": true, 10 | "noempty": true, 11 | "undef": true, 12 | "latedef": "nofunc", 13 | "unused": "vars", 14 | "browser": true, 15 | "node": true 16 | } 17 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: node_js 4 | 5 | node_js: 6 | - "5" 7 | - "4" 8 | - "0.12" 9 | - "0.10" 10 | 11 | after_script: 12 | - npm run coveralls 13 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Alexander Savin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Base router for your JS framework or frameworkless app 2 | 3 | [![Build Status](https://travis-ci.org/apsavin/router-base.svg?branch=master)](https://travis-ci.org/apsavin/router-base) [![Coverage Status](https://coveralls.io/repos/apsavin/router-base/badge.svg)](https://coveralls.io/r/apsavin/router-base) [![NPM version](https://badge.fury.io/js/router-base.svg)](http://badge.fury.io/js/router-base) [![Bower version](https://badge.fury.io/bo/router-base.svg)](http://badge.fury.io/bo/router-base) 4 | 5 | It's abstract and knows nothing about http. It's just matches and generates urls. 6 | 7 | ##How to include it in my app or framework? 8 | 9 | Router supports: 10 | 11 | 1. [node.js](http://nodejs.org) modules, 12 | 2. [requirejs](http://requirejs.org) modules 13 | 3. and, of course, awesome [ym](https://github.com/ymaps/modules) modules. 14 | 4. You can just use the `