Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
AWS Lambda Function for CORS proxy
const axios = require('axios');
exports.handler = async (event) => {
const route = event.path
const request = {
url: '' + route,
method: event.httpMethod,
data: event.body,
params: event.params
const response = await axios(request)
var res = {
"statusCode": 200,
"headers": {
"body": (JSON.stringify(,
"isBase64Encoded": false
return res;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment