Skip to content

Instantly share code, notes, and snippets.

@floAr
Created May 20, 2021 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floAr/95db6ed96b1b0cf70a0513698a3979f7 to your computer and use it in GitHub Desktop.
Save floAr/95db6ed96b1b0cf70a0513698a3979f7 to your computer and use it in GitHub Desktop.
const axios = require('axios');
const decode = require('unescape');
module.exports = async function (context, req) {
var route = decode(context.bindingData.route || req.params.restOfPath);
let params = req.query
delete params['code']
const request = {
url: 'https://secret-2--lcd--full.datahub.figment.io/apikey/xxxxxxxxxxxxxxxx/' + route,
method: req.method,
data: req.rawBody,
params: params
}
const response = await axios(request)
context.res = {
body: response.data
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment