Permalink
Browse files

Fixing README

  • Loading branch information...
PaulKinlan committed May 23, 2011
1 parent 5e89071 commit 11e75a96e85df1280481d426198610bebb1f3de7
Showing with 13 additions and 13 deletions.
  1. +13 −13 README.md
View
@@ -3,24 +3,24 @@ LeviRoutes
A simple lightweight routes framework for hooking in to HTML5 history. Currently when the system pop's state the route is triggered if matched.
- var app = new routes();
+ var app = new routes();
- app.get("/", function(req) {
- alert("State popped for /");
- });
+ app.get("/", function(req) {
+ alert("State popped for /");
+ });
It also named parameters for route syntax
- app.get("/:category", function(req) {
- alert("In " + req.params.category);
- });
+ app.get("/:category", function(req) {
+ alert("In " + req.params.category);
+ });
- app.get("/:category.:format", function(req) {
- alert("format: " + req.params.format);
- });
+ app.get("/:category.:format", function(req) {
+ alert("format: " + req.params.format);
+ });
LeviRoutes can also intercept POST requests via forms, the framework will intercept all submits, and naturally let through requests that don't match the path, whilst firing your callback if there is a mathc
- app.post("/:category", function(req) {
- alert("posting form: In Category ", req.params.category);
- });
+ app.post("/:category", function(req) {
+ alert("posting form: In Category ", req.params.category);
+ });

0 comments on commit 11e75a9

Please sign in to comment.