-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
43 lines (32 loc) · 1.15 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
35
36
37
38
39
40
41
42
43
require("dotenv").config();
var express = require("express");
var bodyParser = require("body-parser");
var orm = require("./config/orm.js");
var session = require("express-session");
var cloudinary = require("./public/assets/js/cloudinary.js");
// cloudinary();
// Sets up the Express App
// =============================================================
var app = express();
var PORT = process.env.PORT || 3009;
// Requiring our models for syncing
// Sets up the Express app to handle data parsing
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.text());
// app.use(bodyParser.json({ type: "application/vnd.api+json" }));
var exphbs = require("express-handlebars");
app.engine("handlebars", exphbs({ defaultLayout: "main" }));
app.set("view engine", "handlebars");
// Static directory
app.use(express.static("public"));
//main route
var routes = require("./controllers/searchController");
app.use("/", routes);
app.listen(PORT);
// Sequelize Functionality
// db.sequelize.sync({ force: true }).then(function() {
// app.listen(PORT, function() {
// console.log("App listening on PORT " + PORT);
// });
// });