Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created October 23, 2018 10:33
Show Gist options
  • Save luandevpro/8516cb3153cd2377de85a71264823a56 to your computer and use it in GitHub Desktop.
Save luandevpro/8516cb3153cd2377de85a71264823a56 to your computer and use it in GitHub Desktop.
// import express
const express = require('express')
app = express()
port = process.env.port || 3000
expressLayout = require('express-ejs-layouts');
// configure application
// tell application express to get static ass css
app.use(express.static(__dirname + '/public'));
// set ejs as engine template for app
app.set('view engine' , 'ejs');
app.use(expressLayout);
// set routes
app.get("/" , (req,res) => {
res.send("hello")
res.end()
})
// listen port
app.listen(port , () => {
console.log(`Da chay server thanh cong ${port}`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment