-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (26 loc) · 912 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
33
34
const express = require('express');
const cors = require('cors');
// const { useTreblle } = require('treblle');
const searchRouter = require('./routes/search.router');
const scheduleRouter = require('./routes/schedule.router');
const StatusRouter = require('./routes/status.router');
const subcriptionRouter = require('./routes/subscription.router');
const LoadSheddingStatusMonitor = require('./LoadSheddingStatusMonitor');
const app = express();
app.use(cors());
app.use(express.json());
// useTreblle(app, {
// apiKey: process.env.apiKey,
// projectId: process.env.projectId,
// })
app.use('/search', searchRouter);
app.use('/schedule', scheduleRouter);
app.use('/status', StatusRouter);
app.use('/subscription', subcriptionRouter);
app.get('/', async (req, res) => {
res.status(200).json({
status: 'API running...'
})
});
new LoadSheddingStatusMonitor();
module.exports = app;