-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
36 lines (32 loc) · 997 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
33
34
35
36
// Dependencies
import "dotenv/config.js";
import express from 'express';
import cors from 'cors';
import morgan from 'morgan';
import { FrontendUrl, BackendUrl } from "./auxillary/globalVariables.js";
// Express Setup
const app = express();
app.use(cors({
origin: '*'
// origin:[FrontendUrl, FrontendUrl + '/*', BackendUrl, BackendUrl + '/*', 'https://kaientai.loca.lt', 'https://kaientai.loca.lt/*'],
}));
app.use(express.json());
app.use(morgan("dev"));
// Routes
import klf from './routes/klf.js';
import order from './routes/order.js';
import orderProduct from './routes/orderProduct.js';
import product from './routes/product.js';
import user from './routes/user.js';
import postcode from './routes/postcode.js';
import supplier from './routes/supplier.js';
import shopifySession from './routes/shopifySession.js';
app.use(klf);
app.use(order);
app.use(orderProduct);
app.use(product);
app.use(user);
app.use(postcode);
app.use(supplier);
app.use(shopifySession);
export default app;