refactor: netease api routes

This commit is contained in:
qier222 2021-06-05 18:01:41 +08:00
parent 7c79afd0d1
commit 996904f056
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
5 changed files with 225 additions and 8810 deletions

View file

@ -196,7 +196,7 @@ export function addOrRemoveTrackFromPlaylist(params) {
export function dailyRecommendTracks() {
return request({
url: '/recommend/songs',
method: 'post',
method: 'get',
params: { timestamp: new Date().getTime() },
}).then(result => {
result.data.dailySongs = mapTrackPlayableStatus(

View file

@ -3,6 +3,7 @@ const bodyParser = require('body-parser');
const cache = require('../../netease_api/util/apicache').middleware;
const fileUpload = require('express-fileupload');
import routes from '../../netease_api/routes';
const clc = require('cli-color');
export function startNeteaseMusicApi() {
// Integrate API
@ -53,6 +54,10 @@ export function startNeteaseMusicApi() {
const host = process.env.HOST || '127.0.0.1';
app.server = app.listen(port, host, () => {
console.log(`server running @ http://${host ? host : 'localhost'}:${port}`);
console.log(
`${clc.redBright('[NetEase API]')} server running @ http://${
host ? host : 'localhost'
}:${port}`
);
});
}