-
-
Save floAr/95db6ed96b1b0cf70a0513698a3979f7 to your computer and use it in GitHub Desktop.
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 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