I’m building a website in which needs to collect user sign up information. Right now I’m hosting the static files (including index.html and main.js) on s3 and sending HTTP post requests to an AWS lambda endpoint which uses mongoose to insert the objects into a mongoDB atlas cluster. So I use serverless-finch to deploy the static assets and serverless to deploy the lambda functions.
So far everything is working alright except for the api gateway endpoint which is hard-coded into the main.js file, which is a bad thing. I’d like to remove that, so I was wondering if there was a way to do so conveniently? Maybe there’s a way for
serverless deploy to output the api gateway string to a file that
serverless client deploy can pick up? Or should I use some custom build tool?
It’s my first time using this framework (or doing any sort of web dev) so for all I know I could be doing everything wrong. Any advice, specific or general is appreciated!