-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
34 lines (25 loc) · 935 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
const express = require("express");
const dotenv = require("dotenv");
dotenv.config();
const path = require('path');
const app = express();
const PORT = process.env.PORT || 8080;
app.use(express.json());
const userRouter = require("./routes/userRouter");
const groupRouter = require("./routes/groupRouter");
const expensesRouter = require("./routes/expensesRouter");
const settlementRouter = require("./routes/settlementRouter");
const profileRouter = require("./routes/profileRouter");
const friendRouter = require('./routes/friendRouter');
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
app.use("/users", userRouter);
app.use("/groups", groupRouter);
app.use("/expenses", expensesRouter);
app.use("/settlement", settlementRouter);
app.use("/profile", profileRouter);
app.use("/friend",friendRouter)
app.listen(PORT, () => {
console.log("server is running at port no 8080");
});