Created
June 25, 2021 02:47
-
-
Save kunxin-chor/33c33751bcb23461cede3bdca158b1f1 to your computer and use it in GitHub Desktop.
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 wax = require("wax-on"); | |
require("dotenv").config(); | |
// create an instance of express app | |
let app = express(); | |
// set the view engine | |
app.set("view engine", "hbs"); | |
// static folder | |
app.use(express.static("public")); | |
// setup wax-on | |
wax.on(hbs.handlebars); | |
wax.setLayoutPath("./views/layouts"); | |
// enable forms | |
app.use( | |
express.urlencoded({ | |
extended: false | |
}) | |
); | |
async function main() { | |
} | |
main(); | |
app.listen(3000, () => { | |
console.log("Server has started"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment