Link to chapter - https://serverless-stack.com/chapters/initialize-the-backend-repo.html
Hi @jayair,
My question is regarding the size of the repo after running ānpm installā which created node_modules.
It seems to me the entire repo including the huge node_modules subdir is then pushed to the github.
bash-3.2$ npm install
...
bash-3.2$ cd ..
bash-3.2$ du -sh serverless-stack-2-api/
127M serverless-stack-2-api/
bash-3.2$
I imagine a lot of whatās in node_modules is only needed during development.
Is it necessary to push 127 MB of node_modules to github?
Thanks very much.
Oh yeah you shouldnāt commit the node_modules/
dir. It is generated every time you run npm install
.
A recommendation - after doing
$ git remote add origin REPO_URL
If we do
npm init (-y)
again, the change (repo field) will be reflected in package.json.
Could be a useful addition to the tutorial.
Ah good point. Iāll look into adding it in.
When I run npm install
, I get the following message: found 128 vulnerabilities (54 low, 55 moderate, 19 high)
Is this the case for everyone else? Is there anything that can be done to remedy these vulnerabilities?
I think you need to run npm audit fix
for that.
Wow, that fixed all of them. Thanks. (Unfortunately it created a few more, which donāt seem to be fixable with npm audit fix, but a few is certainly better than 128.)
Great tutorial, I really, really learned a lot taking some time and doing this while going thru the AWS docsā¦ Quick comment/question, though. I taking the repo here which looks like itās branched after the āDelete Noteā step in section 1ā¦
per the serverless.yml code, itās still looking for the resource/api-gateway-errors.yml file, but the branch actually comes from the step just before that. Obviously, itās no problem to just grab that code and create a new file, but I wanted to point that out in case there was a reason Iām not foreseeing that you chose that particular pointā¦
My guess was that, for wahtever reason, the step adding the API-Gateway resource file was added later and thatās the closest branch to the codebase we want to start withā¦
Anything I should look out for?
Thanks for the kind words.
Great catch! I should update the branch. It should be instead be the API Gateway CORS errors chapter - https://serverless-stack.com/chapters/handle-api-gateway-cors-errors.html.
So the command to clone the repo really should be:
$ git clone --branch handle-api-gateway-cors-errors --depth 1 https://github.com/AnomalyInnovations/serverless-stack-demo-api.git serverless-stack-2-api/
That branch should have the resource it is looking for.
Iāll update the chapter with this as well.