-
-
Save edtoken/385913e911062cdf2e6a9d7d562253db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var app = require('express')(); | |
| var request = require('request'); | |
| app.use(function (req, res, next) { | |
| res.header("Access-Control-Allow-Origin", "*"); | |
| res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
| next(); | |
| }); | |
| var PROXY_API = 'http://194.12.124.4:8092/'; | |
| app.get('*', function (req, res) { | |
| request(PROXY_API).pipe(res); | |
| console.log(req); | |
| }); | |
| app.listen(8080, function () { | |
| console.log('started'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment