-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
26 lines (22 loc) · 1.03 KB
/
server.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
const express = require('express');
const fetchResolvedIssues = require('./services/fetchResolvedIssues');
const fetchTransitions = require('./services/fetchTransitions');
const fetchAggregatedDurations = require('./services/fetchAggregatedDurations');
const fetchReopenedCount = require('./services/fetchReopenedCount');
const { fetchCycleTimeseries } = require('./services/fetchCycleTimeseries');
const { fetchBugCycleTimes } = require('./services/fetchBugCycleTimes');
require('dotenv').config();
const app = express();
const port = process.env.PORT || 3000;
app.get('/fetch-resolved-issues', fetchResolvedIssues);
app.get('/fetch-transitions', fetchTransitions);
app.get('/fetch-aggregated-durations', fetchAggregatedDurations);
app.get('/fetch-reopened-count', fetchReopenedCount);
app.get('/fetch-cycle-timeseries', fetchCycleTimeseries);
app.get('/fetch-bug-cycle-times', fetchBugCycleTimes);
app.get('/health', (req, res) => {
res.status(200).send('Ok');
})
app.listen(port, () => {
console.log(`Server is running on port ${port}`);
});