Created
June 21, 2018 07:54
-
-
Save friedow/cc148883808c0f6bf44d33b202505856 to your computer and use it in GitHub Desktop.
express.js reverse proxy
This file contains 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
const express = require('express'), | |
request = require('request'); | |
const app = express(); | |
app.use('/fpp', function(req, res) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
req.pipe(request("https://api-us.faceplusplus.com/facepp/v3" + req.url)).pipe(res); | |
}); | |
app.listen(process.env.PORT || 3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment