-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
32 lines (24 loc) · 788 Bytes
/
app.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
const express = require("express");
const app = express();
const port = process.env.PORT || 4000;
const cors = require('cors')
require('dotenv').config();
// just a comment
// added by Kap
// we'll need to change this origin back to netlify's url when we go live which I'll set it up in ENV file
app.use(
cors({
origin: process.env.CORS_ORIGIN
})
)
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.static("public"));
app.use('/', require('./routes/watches'));
app.use('/', require('./routes/carts'));
app.use('/', require('./routes/customers'));
app.use('/', require('./routes/admins'));
app.use('/', require('./routes/cart-watch'));
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});