0.0.9 • Published 11 years ago

lilrouter v0.0.9

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

lilrouter

A li'l router for your browser

Usage

load dist/lilrouter.js or dist/lilrouter.min.js in your browser and call it like this:

(function () {

  var lilRouter = require('lilrouter');

  var router = lilRouter.create({

    init: function (router) {
      //called on page load  
      var session = { userId: '1231l2jl12' }
      return session;
    },
    get: {
      '/': function (context, router) {
        //context.session.userId = '1231l2jl12'
      }
    },
    post: {
      '/beer/:beerId/edit': function (context, router) {
        //context.session.userId = '1231l2jl12'
        //context.params.beerId = '123lkj'
        //context.body.name = 'pils'
      }
    }

  });

  router.get('/');
  router.post('/beer/123lkj/edit', { name: 'pils' });


}());

License

Copyright (c) 2012 August Hovland Licensed under the MIT license.

0.0.9

11 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago