An open API service indexing awesome lists of open source software.

https://github.com/lovesaroha/lrouter.js

lrouter is a lightweight javaScript library to provide an API for handling hash routes.
https://github.com/lovesaroha/lrouter.js

html javascript-library router

Last synced: 3 months ago
JSON representation

lrouter is a lightweight javaScript library to provide an API for handling hash routes.

Awesome Lists containing this project

README

          

# lrouter Javascript Library
lrouter is a lightweight javascript library to provide an API for handling hash routes.

## Installation

```html

```

## Usage

```js
// Create a router.
let router = lrouter.Create();

// Define routes.
router.Add("/#/" , function() {
console.log("Home Page");
});

router.Add("/#/login" , function() {
console.log("Login Page");
});

// Routes with parameters (/#/articles?category=sports&limit=10).
router.Add("/#/articles" , function(parameters) {
console.log("Articles Page");
let category = parameters.category;
let limit = parameters.limit;
});
```