-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.js
35 lines (26 loc) · 1 KB
/
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
32
33
34
var express = require("express");
var bodyParser = require("body-parser");
var mysql = require("mysql");
var path = require("path");
var exphnd = require("express-handlebars");
var app = express();
const jwt = require('jwt-express');
var PORT = process.env.PORT || 8080;
app.use(express.static("public"));
//change views directory to public, and move CSS and other stuff to it. Compare to what's in public directory on cats activity
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(jwt.init("WCFQC9PY8QAFVHUR6XZHG225ZGG5GFTJGILN", {
cookies: false
}));
app.engine("handlebars", exphnd({ defaultLayout: "main" }));
app.set("view engine", "handlebars");
var proutes = require("./controllers/passport.js");
var routes = require("./controllers/itemsController.js");
require("./controllers/index.js")(app, jwt);
app.use(routes);
// require("./controllers/inventory.js");
app.use(proutes);
app.listen(PORT, () => {
console.log("App listening on PORT: localhost:" + PORT);
});