server.js 904 Bytes
Newer Older
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
1 2 3 4
const express = require("express");
const router = require("./routers");
const cors = require("cors");
const bodyParser = require("body-parser");
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
5 6 7 8 9

const port = process.env.PORT || 9000;
const app = express();

app.use(cors());
10 11
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
12 13 14 15 16 17
app.use("/api/auth", router.auth);
app.use("/api/list", router.list);
app.use("/api/shop", router.shop);
app.use("/api/promotion", router.promotion);
app.use("/api/review", router.review);
app.use("/api/booking", router.booking);
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
18
app.use("/api/storage", router.storage);
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
19 20 21 22
app.use("/api/storageprofile", router.storageprofile);
app.use("/api/storageshop", router.storageshop);
app.use("/api/storagebeautician", router.storagebeautician)
app.use("/api/beautician", router.Beautician)
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
23
app.listen(port, () => {
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
24
  console.log("Express server listening on port " + port);
Piyaphorn Arphornsri's avatar
Piyaphorn Arphornsri committed
25
});