locktongue / routing2

:triangular_flag_on_post: Parse HTTP Routing definition.

Home Page:https://npmjs.org/routing2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

routing2 routing2

parse http routing define

Define

Installation

$ npm install routing2

Example

const routing = require('routing2');

const routes = routing.parse(`
get /:name => home#index , a=1, b=2
`);

console.log(routes); // ->
{
	method: 'get',
	path: '/:name',
	controller: 'home',
	action: 'index',
	options: { a:1, b:2 }
}

Contributing

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3

ISC

This work is licensed under the ISC license.


About

:triangular_flag_on_post: Parse HTTP Routing definition.

https://npmjs.org/routing2

License:ISC License


Languages

Language:JavaScript 100.0%