Skip to content
Myr

add another route example to express(1) so people are not so confused

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by TJ Holowaychuk · committed by TJ Holowaychuk · parent f7c1c63 · Browse files · 1 file+18 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+18 added−0 removed

  • other:+18 added−0 removed

1 file+18 added−0 removed

modified:bin/express+18 added
53 unmodified lines
54 , '};'55].join(eol);5657/**58 * Routes users template.59 */6061var users = [62 ''63 , '/*'64 , ' * GET users listing.'65 , ' */'66 , ''67 , 'exports.list = function(req, res){'68 , ' res.send("respond with a resource");'69 , '};'70].join(eol);7172/**73 * Jade layout template.74 */7576var jadeLayout = [
132 unmodified lines
209 , ' */'210 , ''211 , 'var express = require(\'express\')'212 , ' , routes = require(\'./routes\')'213 , ' , user = require(\'./routes/user\')'214 , ' , http = require(\'http\')'215 , ' , path = require(\'path\');'216 , ''217 , 'var app = express();'
14 unmodified lines
232 , ' app.use(express.errorHandler());'233 , '});'234 , ''235 , 'app.get(\'/\', routes.index);'236 , 'app.get(\'/users\', user.list);'237 , ''238 , 'http.createServer(app).listen(app.get(\'port\'), function(){'239 , ' console.log("Express server listening on port " + app.get(\'port\'));'240 , '});'
55 unmodified lines
296 });297298 mkdir(path + '/routes', function(){299 write(path + '/routes/index.js', index);300 write(path + '/routes/user.js', users);301 });302303 mkdir(path + '/views', function(){304 switch (program.template) {
118 unmodified lines