-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
32 lines (25 loc) · 1021 Bytes
/
index.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 dotenv = require('dotenv');
const express = require('express');
const error = require('./middleware/error');
// const { auth } = require('./middleware/auth');
const userRouter = require('./controller/user');
const loginRouter = require('./controller/login');
const profitRouter = require('./controller/profit');
const balanceRouter = require('./controller/balance');
const depositRouter = require('./controller/deposit');
const paymentRouter = require('./controller/payment');
const transactionRouter = require('./controller/transaction');
dotenv.config();
const app = express();
app.use(express.json());
app.use('/user', userRouter);
app.use('/login', loginRouter);
app.use('/profit', profitRouter);
app.use('/balance', balanceRouter);
app.use('/deposit', depositRouter);
app.use('/payment', paymentRouter);
app.use('/transaction', transactionRouter);
app.use(error);
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`Iron Bank API running on port ${PORT}`));
module.exports = app;