https://github.com/paulannekov/mighty-lambda-proxy
Flexible AWS Lambda proxy server.
https://github.com/paulannekov/mighty-lambda-proxy
cors-proxy lambda-functions serverless
Last synced: about 1 year ago
JSON representation
Flexible AWS Lambda proxy server.
- Host: GitHub
- URL: https://github.com/paulannekov/mighty-lambda-proxy
- Owner: PaulAnnekov
- Created: 2019-06-08T21:36:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T17:48:58.000Z (over 3 years ago)
- Last Synced: 2025-01-13T18:51:26.061Z (about 1 year ago)
- Topics: cors-proxy, lambda-functions, serverless
- Language: TypeScript
- Homepage:
- Size: 992 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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()](https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html)). 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](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-usageplan.html), [CORS settings](https://serverless.com/blog/cors-api-gateway-survival-guide/), 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