Skip to content

Instantly share code, notes, and snippets.

@floAr
Created May 20, 2021
Embed
What would you like to do?
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