Skip to content

Commit

Permalink
Update docs with Express 3.x compatible instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
kishorenc committed Sep 24, 2012
1 parent 21eba9c commit e705d57
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions README.md
@@ -1,22 +1,29 @@
#Road - route helper for Express

A route helper for express that allows you to map routes, controllers and views by following logical conventions. See example application for use cases. You need express 2.x and ejs available to run the example.
A route helper for express that allows you to map routes, controllers and views by following logical conventions. See example application for use cases. You need Express 3.x or Express 2.x and ejs available to run the example.

##Installation

npm install road

## Express 3.x

The following guide is for Express 3.x. If you using Express 2.x, please refer to the `0.3` branch for instructions.

##Features

* Wire your routes to individual controllers and views using convention
* Define custom routes which map custom URLs to specific controller methods
* Serve the views in custom MIME types
* View helper for serving JavaScript objects as application/json

##Comptability
##Compatibility

* Tested with Express 3.x and Express 2.x

* Works on both node 0.4.x and 0.6.x
* Tested with Express 2.5.x
##v0.4.0

Road 0.4.x is compatible with Express 3.x. Road also works on Express 2.x, but you have to check the `0.3` branch for instructions.

##Changes in v0.3.x

Expand All @@ -26,13 +33,15 @@ See example application for complete use cases.

##Quick Start

Integrating Road with your Express application is really simple. Tell Express to let Road handle the routing this way:
Integrating Road with your Express application is really simple.

``` javascript
var road = require('road');
// create an express app
var app = express();

// mount application routes using road
app.use(express.router(road));
// initialize road this way
var road = require('road');
road(app);
```

Road, by convention, expects you to drop your controllers into the `controllers` folder in your application root.
Expand Down Expand Up @@ -233,7 +242,7 @@ Run the tests from the test folder this way:

(The MIT License)

Copyright (c) 2011 Kishore Nallan <kishore@kishorelive.com>
Copyright (c) 2011-2012 Kishore Nallan <kishore@kishorelive.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down

0 comments on commit e705d57

Please sign in to comment.