kirillbaryba / mighty-lambda-proxy

Flexible AWS Lambda proxy server.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mighty Lambda proxy

Flexible AWS Lambda proxy server. Unlike other solutions, it supports any request/response payload (gzip, br, image, xml, json, etc.). Also you can easily enable CORS for endpoints which don't allow cross-origin requests.

How to use

git clone https://github.com/PaulAnnekov/mighty-lambda-proxy.git
cd mighty-lambda-proxy
npm install
npx serverless deploy -v # or node_modules/.bin/serverless deploy -v

In the output you will see your endpoint url. To make it proxy your request, just add ?url=[target] in the end, e.g.:

https://abcdefghij.execute-api.eu-central-1.amazonaws.com/dev?url=https://example.com

Proxy timeout

By default function asks Lambda service for timeout value (getRemainingTimeInMillis()). But you can specify your own timeout value by following "Set usagePlan, CORS settings, proxy timeout" guide below.

Configure

Set stage during deploy

npx serverless deploy --stage prod

Set region during deploy

npx serverless deploy --region eu-central-1

Set UsagePlan, CORS settings, proxy timeout

  1. Copy serverless.vars.sample.yml and rename to serverless.vars.yml
  2. In serverless.vars.yml modify and leave options you need

About

Flexible AWS Lambda proxy server.


Languages

Language:TypeScript 100.0%