Skip to content
This repository has been archived by the owner on May 30, 2020. It is now read-only.

Commit

Permalink
[Docs] Beautify
Browse files Browse the repository at this point in the history
  • Loading branch information
sundowndev authored Feb 26, 2019
1 parent a66b879 commit d5fa421
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
</p>

<p align="center">
<a href="https://travis-ci.org/sundowndev/leafeon"><img src="https://api.travis-ci.org/sundowndev/leafeon.svg?branch=master" alt="Build status"></a>
<a href="https://coveralls.io/github/sundowndev/leafeon?branch=master"><img src="https://coveralls.io/repos/github/sundowndev/leafeon/badge.svg?branch=master" alt="Code coverage"></a>
<a href="https://travis-ci.org/sundowndev/leafeon"><img src="https://img.shields.io/travis/sundowndev/leafeon/master.svg?style=flat-square" alt="Build status"></a>
<a href="https://coveralls.io/github/sundowndev/leafeon?branch=master"><img src="https://img.shields.io/coveralls/sundowndev/leafeon/master.svg?style=flat-square" alt="Code coverage"></a>
<a href="https://github.com/sundowndev/leafeon/releases"><img src="https://img.shields.io/github/tag/Sundowndev/leafeon.svg?style=flat-square" alt="Version"></a>
<a href="#"><img src="https://img.shields.io/badge/minified%20size-4kb-brightgreen.svg?style=flat-square" alt="Size minified"></a>
</p>
Expand Down Expand Up @@ -62,7 +62,54 @@ leafeon.map('docs_', '/docs', [
]);
~~~

### API
## Installation (npm)

~~~bash
$ npm i leafeon
~~~

#### Usage

```js
const leafeon = require('leafeon').Router();

leafeon.add('home', '/', function () {
document.write('hello world');
}).run();
```

## Browser usage

1. Include leafeon.js in **<head>** or at the end of the **<body>**

~~~html
<script src="leafeon.min.js"></script>

<!-- or via jsdelivr CDN -->
<script src="https://cdn.jsdelivr.net/gh/sundowndev/leafeon@latest/dist/leafeon.min.js"></script>
~~~

2. Init the router

~~~js
const leafeon = new leafeon.Router();
~~~

3. Create some routes and run the router

~~~js
leafeon
.add('home', '/', () => { /* ... */ })
.add('contact', '/contact', () => { /* ... */ })
.setErrorCallback(() => { /* ... */ })
.run();
~~~

## Browser support

Supports IE 11+, Chrome 43+, Opera 29+, and Firefox 41+

## API

#### `.add(name: string, path: string, callback: function)`

Expand Down Expand Up @@ -130,53 +177,6 @@ Register a middleware that will be executed before given path. Type **`*`** to t

Run the router with registered routes. Optionally, register a middleware that will be executed after every routes callback.

## Installation (npm)

~~~bash
$ npm i leafeon
~~~

#### Usage

```js
const leafeon = require('leafeon').Router();

leafeon.add('home', '/', function () {
document.write('hello world');
}).run();
```

## Browser usage

1. Include leafeon.js in **<head>** or at the end of the **<body>**

~~~html
<script src="leafeon.min.js"></script>

<!-- or via jsdelivr CDN -->
<script src="https://cdn.jsdelivr.net/gh/sundowndev/leafeon@latest/dist/leafeon.min.js"></script>
~~~

2. Init the router

~~~html
const leafeon = new leafeon.Router();
~~~

3. Create some routes and run the router

~~~js
leafeon
.add('home', '/', () => { /* ... */ })
.add('contact', '/contact', () => { /* ... */ })
.setErrorCallback(() => { /* ... */ })
.run();
~~~

## Browser support

Supports IE 11+, Chrome 43+, Opera 29+, and Firefox 41+

## License

This repository is MIT licensed.
Expand Down

0 comments on commit d5fa421

Please sign in to comment.