Created
July 12, 2020 22:24
-
-
Save risenW/3e9ce672b0ba0447d5b3684a98fc26fd to your computer and use it in GitHub Desktop.
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 bodyParser = require("body-parser"); | |
const expressHbs = require("express-handlebars"); | |
const books = require("./data/web_book_data.json") | |
const model = require("./model") | |
const app = express(); | |
app.set("views", "./views"); | |
app.set("view engine", "hbs"); | |
//Body parser middleware | |
app.use( | |
bodyParser.urlencoded({ | |
extended: false | |
}) | |
); | |
app.use(bodyParser.json()); | |
app.engine('.hbs', expressHbs({ | |
defaultLayout: 'layout', | |
extname: '.hbs' | |
})); | |
app.get("/", (req, res) => { | |
res.render("index") | |
}); | |
module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment