Skip to content

Instantly share code, notes, and snippets.

@wellingtonpgp
Created July 11, 2016 18:20
Show Gist options
  • Save wellingtonpgp/36bb39531e6f4ca59f3e1e99564653cc to your computer and use it in GitHub Desktop.
Save wellingtonpgp/36bb39531e6f4ca59f3e1e99564653cc to your computer and use it in GitHub Desktop.
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