forked from StanStanley512/Project2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
33 lines (24 loc) · 849 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
32
33
require("dotenv").config();
var express = require("express");
var bodyParser = require("body-parser");
var db = require("./models");
var app = express();
var PORT = process.env.PORT || 3000;
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
// Static directory
// app.use(express.static(path.join(__dirname, "public")));
app.use(express.static("public"))
// // Routes
// =============================================================
require("./routes/htmlRoutes")(app);
require("./routes/itemRoutes")(app);
require("./routes/userRoutes")(app);
// Starts the server to begin listening
// =============================================================
db.sequelize.sync({ force: true }).then(function() {
app.listen(PORT, function() {
console.log("App listening on PORT " + PORT);
});
});
module.exports = app;