Skip to content

Commit

Permalink
feat: add express & handlebars
Browse files Browse the repository at this point in the history
  • Loading branch information
JHIH-LEI committed Jul 20, 2021
0 parents commit d5f8de4
Show file tree
Hide file tree
Showing 7 changed files with 1,367 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules
.DS_Store
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"exphbs"
]
}
17 changes: 17 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const express = require('express')
const app = express()

const exphbs = require('express-handlebars')

const port = 3000

app.engine('handlebars', exphbs({ defaultLayout: 'main' }))
app.set('view engine', 'handlebars')

app.get('/', (req, res) => {
res.render('index')
})

app.listen(port, () => {
console.log(`express is running on http://localhost:${port}`)
})
Loading

0 comments on commit d5f8de4

Please sign in to comment.