Created
November 27, 2017 04:29
-
-
Save hitalos/4a3b2bbe9de283f9aafe9d6e6c3120b3 to your computer and use it in GitHub Desktop.
Exemplo de aplicação web usando templates e arquivos estáticos
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
const express = require('express') | |
const app = express() | |
app.set('view engine', 'pug') | |
app.get('/', (req, res) => { | |
res.render('index', { title: 'Express' }) | |
}) | |
app.use(express.static('public')) | |
app.listen(8000, () => { | |
console.log('Express listening at: http://localhost:8000/') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment