-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
28 lines (21 loc) · 862 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const express = require("express");
const hbs = require("hbs");
const parser = require("body-parser");
const methodOverride = require("method-override");
// require controllers
const usersController = require("./controllers/users");
const miniaturesController = require("./controllers/miniatures");
const paintsController = require("./controllers/paints");
const app = express();
app.set("view engine", "hbs");
app.use(parser.urlencoded({ extended: true }));
app.use(methodOverride("_method"));
app.use("/public", express.static("public"));
app.use("/", usersController);
app.use("/miniatures", miniaturesController);
app.use("/paints", paintsController);
// app.listen(5000, () => console.log("Running on port 5000"));
app.set("port", process.env.PORT || 5000);
app.listen(app.get("port"), () => {
console.log(`✅ PORT: ${app.get("port")} 🌟`);
});