-
Notifications
You must be signed in to change notification settings - Fork 0
/
service.js
36 lines (28 loc) · 975 Bytes
/
service.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
var express = require('express')
var proxyServer = require('http-route-proxy');
var port = process.env.PORT || 3000;
var app = express();
app.use(proxyServer.connect({
to: 'www.google.com',
route: [{action: '/mp3-preview', forward: 'p.scdn.co'},
{action: '/image', forward: 'i.scdn.co', headers: {res: {'access-control-allow-origin': '*'}}}]
}));
//app.use(express.favicon());
//app.use(express.logger('dev'));
//app.use(express.bodyParser());
//app.use(express.methodOverride());
//app.use(app.router);
//app.use(express.static(path.join(__dirname, 'public')));
var port = process.env.PORT || 3000;
app.listen(port, function(){
console.log("LISTNEIN!!!")
//console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
});
/*
proxyServer.proxy([
{
from: 'uncovered-proxy.herokuapp.com',
to: 'p.scdn.co',
}
]);*/
//https://p.scdn.co/mp3-preview/f60c420261754542594ddb4a46ed42972d2b9fd0