Skip to content

Instantly share code, notes, and snippets.

View bomzj's full-sized avatar
🤖
AI Engineering

Maksim Shamihulau bomzj

🤖
AI Engineering
View GitHub Profile
@bomzj
bomzj / cors-proxy.js
Last active August 20, 2022 10:30
CORS Proxy AWS lambda function
/* Proxies http(s) requests to any endpoint even if doesn't allow CORS */
import axios from 'axios'
import qs from 'qs'
import https from 'https'
import http from 'http'
import fetch from 'node-fetch'
// Serialize query params that represents object with props
axios.defaults.paramsSerializer = params => qs.stringify(params)