Created
October 23, 2018 10:33
-
-
Save luandevpro/8516cb3153cd2377de85a71264823a56 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
// 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