-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
24 lines (17 loc) · 736 Bytes
/
Copy pathserver.js
File metadata and controls
24 lines (17 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const express = require('express');
const app = express();
const port = 8000;
const cors = require("cors");
require('dotenv').config();
const cookieParser = require('cookie-parser')
require("./server/config/mongoose.config");
app.use(express.json(), express.urlencoded({ extended: true }));
app.use(cors({credentials: true, origin: 'http://localhost:3000'}));
app.use(cookieParser());
const AllMyUserRoutes = require("./server/routes/user.routes");
AllMyUserRoutes(app);
const AllMyWatchlistRoutes = require("./server/routes/watchlist.routes");
AllMyWatchlistRoutes(app);
const AllMyShowRoutes = require("./server/routes/show.routes");
AllMyShowRoutes(app);
app.listen(port, () => console.log(`Listening on port: ${port}`) );