Skip to content

Instantly share code, notes, and snippets.

@kunxin-chor
Created June 25, 2021 02:47
Show Gist options
  • Save kunxin-chor/33c33751bcb23461cede3bdca158b1f1 to your computer and use it in GitHub Desktop.
Save kunxin-chor/33c33751bcb23461cede3bdca158b1f1 to your computer and use it in GitHub Desktop.
Express Boilerplate
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