Skip to content

Commit

Permalink
set app.js, modify how port access in index.js
Browse files Browse the repository at this point in the history
Relates #10
  • Loading branch information
jackbridger committed Aug 22, 2019
1 parent 1bbfa3c commit fcb20ce
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
const express = require('express');
const express = require("express");
const app = express();
const exphbs = require("express-handlebars");
const path = require("path");
const controllers = require("./controllers/index");

app.set("port", process.env.PORT || 3000);
app.set("views", path.join(__dirname, "views"));
app.set("view engine", "hbs");

app.engine(
"hbs",
exphbs({
extname: "hbs",
layoutDir: path.join(__dirname, "views", "layouts"),
partialsDir: path.join(__dirname, "views", "partials"),
defaultLayout: "main"
})
);

module.exports = app;

0 comments on commit fcb20ce

Please sign in to comment.