Created
February 21, 2014 11:27
-
-
Save jorgeguberte/9132733 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var load = require('express-load'); | |
var routes = require('./routes'); | |
var user = require('./routes/user'); //Chamou o routes/user aqui | |
var app = express(); | |
app.set('views', __dirname + '/views'); | |
app.set('views engine', 'ejs'); | |
app.use(express.static(__dirname + '/public')); | |
app.get('/', routes.index); | |
app.get('/usuarios', user.index); | |
app.get('/usuarios/biografia', user.biografia); | |
load('models') | |
.then('controllers') | |
.then('routes') | |
.into(app); | |
app.listen(3000, function () { | |
console.log('Ntalk no ar.'); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* routes/user.js | |
*/ | |
exports.index = function(req, res){ | |
res.send('user::index'); | |
} | |
exports.biografia = function(req, res){ | |
res. send('user::biografia'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment