Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feat/296 allow access from cross origin in lambda and api gateway #297

Conversation

taniguchiiqqq
Copy link
Member

Overviews of implementation

Allow access from localhost:3000. I ensured that the CORS error were resolved using front app and my personal AWS env.

Review points

I began to think about whether I should define those addresses somewhere instead of hard coding. What do you think about it?

@taniguchiiqqq taniguchiiqqq linked an issue Feb 14, 2024 that may be closed by this pull request
2 tasks
@hitohata
Copy link
Member

hitohata commented Feb 15, 2024

These values are static, so I prefer defining them in the settings file.

I began to think about whether I should define those addresses somewhere instead of hard coding. What do you think about it?

How about hosting on the Dyanamo? Or, in the environment value?
If you get this value on the top of the code, it can be used for a whole until the lambda is shouted down. This means this value works as a constant while the lambda is alive. So, we don't need to get this value from the DB after the init phase.
https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html

To the sake of understanding, I deployed a lambda function on our account of AWS named the "random". Please run the test. I set it to show a random value as a body. If you invoke it two more times, you will find the random value is completely the same.

Anyway for the speed of development, I approve this PR.

@taniguchiiqqq
Copy link
Member Author

Thank you so much for sharing the idea and even making the example! I'll take a look later. for now I prioritize deploying this change

@taniguchiiqqq taniguchiiqqq merged commit 5e77abf into develop Feb 15, 2024
5 checks passed
@taniguchiiqqq taniguchiiqqq deleted the feat/296-allow-access-from-cross-origin-in-lambda-and-api-gateway branch February 15, 2024 01:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow access from cross origin in Lambda and API Gateway
2 participants