Created
June 6, 2022 03:42
-
-
Save kunxin-chor/f7baf3f63edefd9e7e969c4138eb1b42 to your computer and use it in GitHub Desktop.
TGC 18 Express Boilerplate
This file contains hidden or 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 hbs = require('hbs'); | |
const waxOn = require('wax-on'); | |
let app = express(); //create the express application | |
app.set('view engine', 'hbs'); // inform express that we are using hbs as the view engine | |
waxOn.on(hbs.handlebars); // enable wax-on for handlebars (for template inheritance) | |
waxOn.setLayoutPath('./views/layouts') // inform wax-on where to find the layouts | |
app.use(express.urlencoded({ | |
'extended':false // for processing HTML forms usually it's false because | |
// HTML forms are usually quite simple | |
})) | |
// routes | |
app.get('/', function(req,res){ | |
res.send("hello world") | |
}) | |
app.listen(3000, function(){ | |
console.log("server started"); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment