-
Notifications
You must be signed in to change notification settings - Fork 631
/
Copy pathapiDeprecated.js
84 lines (73 loc) · 3.16 KB
/
apiDeprecated.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// eslint-disable-next-line new-cap
const router = require('express').Router();
router.get('/historical', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/historical instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/historical/:country', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/historical instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/jhucsse', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/jhucsse instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/all', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/all instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/countries', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/countries instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/countries/:query', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/countries instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/states', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/states instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/yesterday', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/countries?yesterday=true instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/yesterday/all', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/all?yesterday=true instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
router.get('/yesterday/:query', async (req, res) => res
.header('Warning', '299 - "This endpoint is deprecated. Check out the docs for details."')
.status(410)
.send({
message: 'This endpoint has been deprecated. Use /v3/covid-19/countries?yesterday=true instead.',
docs: `${req.protocol}://${req.get('host')}/docs`
}));
module.exports = router;