[!NOTE]
- Why I wrote this: I was learning GraphQL in Apollo server’s doc and they were talking about CORS HTTP-header-based protocol that dawned on me that I do not have a hands on experience with it.
- Need to learn what is CORS? Read this then.
Preparation
-
We need to define an env variable for frontend URL to read it in runtime.
That is if you do not wanna hardcode your frontend URL in your backend codebase!
-
First I wanna do it a bit manually.
-
TK – Automated with Terraform, or maybe add SSL first to it and then automation.