jeremydaly / lambda-api

Lightweight web framework for your serverless applications
https://serverless-api.com
MIT License
1.41k stars 125 forks source link

Running locally #184

Closed SeriesOfUnlikelyExplanations closed 2 years ago

SeriesOfUnlikelyExplanations commented 3 years ago

Hi - I am writing a script that will allow me to run a lambda-api program locally (without using SAM, etc). Here is what I have so far: https://github.com/SeriesOfUnlikelyExplanations/always-onward/blob/main/local.js

It's working great, except for a weird issue where I only get one cookie in the response despite setting 3 cookies in the lamba-api response. When I deploy it, I get all three cookies back - so it is working as expected through cloudfront/api gateway.

Any ideas on how I can get all three cookies back when I run locally?

Thanks, Tom

SeriesOfUnlikelyExplanations commented 2 years ago

@jeremydaly - Do you mind taking a look at this one? I believe it has something to do with how Node overwrites duplicate values when creating an object.

SeriesOfUnlikelyExplanations commented 2 years ago

Figured it out. Needed to send multiValueHeaders in the request to get multiValueHeaders in the response.