-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (35 loc) · 1.53 KB
/
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
35
36
37
const Router = require('express').Router;
const detail = require('../services/detail');
const uploader = require('../services/uploader');
const search = require('../services/search');
const download = require('../services/download');
const latest = require('../services/latest');
const rating = require('../services/rating');
const plays = require('../services/plays');
const fullSpread = require('../services/fullSpread');
const song = require('../services/song');
const vote = require('../services/vote');
const cdn = require('../services/cdn');
const advanced = require('../services/advanced');
const router = Router();
router.use('/api/maps/detail/:id', detail);
router.use('/api/maps/by-hash/:hash', detail);
router.use('/api/maps/uploader/:id/:page?', uploader);
router.use('/api/search/text/:page?', search);
router.use('/api/download/key/:id', download);
router.use('/api/download/hash/:hash', download);
router.use('/api/stats/key/:id', detail);
router.use('/api/stats/by-hash/:hash', detail);
router.use('/api/songs/detail/:id', song);
router.use('/api/songs/search/hash/:hash', song);
router.use('/api/vote/steam/:id', vote);
router.use('/api/maps/latest/:page?', latest);
router.use('/api/maps/rating/:page?', rating);
router.use('/api/maps/plays/:page?', plays);
router.use('/cdn/:id/:file', cdn);
// partially support the following apis
router.use('/api/search/advanced/:page?', advanced);
// fake support the following apis
router.use('/api/maps/downloads/:page?', fullSpread);
router.use('/api/maps/hot/:page?', fullSpread);
module.exports = router;