-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
23 lines (20 loc) · 603 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
/**
* dir/file: app.js
* @author: (c) Noor Salim
* timestamp: 2023-06-04T21:02:21 GMT+05:30
*/
const express = require('express');
const app = express();
const cors = require('cors');
const userRouter = require('./routers/user.route');
const adminRoute = require('./routers/admin.route');
app.use(cors());
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use('/api/user', userRouter);
app.use('/api/admin', adminRoute);
app.get('/', (req, res) => {
res.status(200).send('Hello!');
});
app.use('/health', (req, res) => res.redirect(307, '/'));
module.exports = app;