app.get('/user/login', routes.user.login)
var app = require('../app');
app.get('/user/login, function(req, res, next) { // code here });
require('./routes')(app);
module.exports = function(app) {
app.get('/routes/user', function(req, res, next){// code here})
}
get/index.js
var app = module.export
// url: / url: /index goes here
app.index = function(req, res) {}
// url: /user goes here and all request of /user/* not found matchs goes here
app.user = require('./user')
get/user.js
// url: /user/ and url: /user/index goes here
user.index = function(req, res){}
// url: /user/login goes here
user.login = function(req, res) {}
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
2012/4/28 tjholowaychuk <tjholo...@gmail.com>
Where *did* you get that graphic? LOL.
app.get('/', function(req, res) { res.send(); })
app.get('/user/:userid', function(req, res) { res.send() });
app.get('/', funtion(req, res) { res.end( 'hello world' ) })
app.get('/user/:userid', function(req, res) { res.end( req.params.userid ) })
Where *did* you get that graphic? LOL.
On Apr 27, 2012 11:46 AM, "Marak Squires" <marak....@gmail.com> wrote:
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en