-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.route.js
47 lines (33 loc) · 1.27 KB
/
index.route.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
37
38
39
40
41
42
43
44
45
46
47
const express = require('express');
const path = require('path');
const userRoutes = require('./server/user/user.route');
const authRoutes = require('./server/auth/auth.route');
// const todoRoutes = require('./server/todo/todo.route');
const adminRoutes = require('./server/admin/admin.route');
const couponRoutes = require('./server/coupon/coupon.route');
const prizeRoutes = require('./server/prize/prize.route');
const mediaRoutes = require('./server/media/media.route');
const router = express.Router(); // eslint-disable-line new-cap
// TODO: use glob to match *.route files
/** GET /health-check - Check service health */
router.get('/health-check', (req, res) =>
res.send('OK')
);
router.get('/admin', (req, res) => {
res.sendFile(path.join(__dirname, 'dist/index.html'));
});
// mount user routes at /users
router.use('/users', userRoutes);
// mount admins routes at /admins
router.use('/admins', adminRoutes);
// mount coupon routes at /coupons
router.use('/coupons', couponRoutes);
// mount prize routes at /prizes
router.use('/prizes', prizeRoutes);
// mount media routes at /media
router.use('/media', mediaRoutes);
// mount auth routes at /auth
router.use('/auth', authRoutes);
// mount todos routes at /todos
// router.use('/todos', todoRoutes);
module.exports = router;