-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
31 lines (20 loc) · 824 Bytes
/
server.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
29
30
31
// var path = require("path");
var express = require("express");
var bodyParser = require("body-parser");
var exphbs = require("express-handlebars");
var router = express.Router();
var path = require("path");
var app = express();
var PORT = process.env.PORT || 3000;
app.use(bodyParser.urlencoded({ extended: true }));
require("./controllers/beer_controllers.js")(app);
// var routes = require("./controllers/beer_controllers.js");
app.engine("handlebars", exphbs({defaultLayout: "main"}));
app.set("view engine", "handlebars");
app.set("views", path.join(__dirname, "views"));
// app.use(express.static("public"));
app.use(express.static(path.join(__dirname, "public")));
console.log("app listing on port ", PORT);
// console.log("__dirname is ", __dirname);
app.listen(PORT);
// (path.join(__dirname, "public");