Created
July 11, 2016 18:20
-
-
Save wellingtonpgp/36bb39531e6f4ca59f3e1e99564653cc to your computer and use it in GitHub Desktop.
This file contains 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 app = express(); | |
app.use(express.static('public')); | |
app.set('views','./src/views'); | |
app.set('view engine','ejs'); | |
app.get('/', function (req, res) { | |
res.render('index', {title: 'Hello fron render',list: ['a','b','c']}); | |
}); | |
app.set('view engine','jade'); | |
app.get('/', function (req, res) { | |
res.render('index', {list: ['a','b','c']}); | |
}); | |
var handlebars = require('express-handlebars'); | |
app.engine('.hbs', handlebars({extname: '.hbs'})); | |
app.set('view engine','.hbs'); | |
app.get('/books', function (req, res) { | |
res.send('Hello books'); | |
}); | |
var port = process.env.PORT || 5000; | |
app.listen(port, function(err) { | |
console.log('Servidor na port '+port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment