Skip to content

Instantly share code, notes, and snippets.

@friedow
Created June 21, 2018 07:54
Show Gist options
  • Save friedow/cc148883808c0f6bf44d33b202505856 to your computer and use it in GitHub Desktop.
Save friedow/cc148883808c0f6bf44d33b202505856 to your computer and use it in GitHub Desktop.
express.js reverse proxy
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