Consider about where to store an endpoint before deciding to use API gateway.
I have been studying AWS recently, and I managed to come up with an idea of a service. However, I gave it up. I’ll summarize the story.
The service’s specification
I’m working as a freelance software engineer, and I have to calculate how long I worked this month every month to give a company a billing. Sometimes, it is so boring that I tried to automate it. The tech I was going to use was…
Frontend: HTML
backend: Go
That’s all. Super simple. I don’t want to do complex stuff.
Besides, the architecture in my mind was…
Like this.
The html file is in S3 and the Go file is in Lambda. Looked good.
A problem I faced
However, I faced a problem where I should store an endpoint generated by API gateway…
It is too dangerous to hardcode the endpoint in html files. There were two options.
- Adopt environment variables by using Javascript FW.
- Give up the architecture and use EC2.
My decision
I gave up both of them because,
it is too costly to use Javascript FW for only managing environment variables. Besides, using EC2 was not attractive to me because I had the experience in using it.
Therefore, I gave up this service, but I learned great stuff, which is we need to consider about where to store environment variables before deciding to use API gateway.