Organize the Backend Repo
Let’s make a couple of quick changes to our project before we get started.
Remove Unused Files
We have a couple of files as a part of the starter project that we can now remove.
$ rm handler.js $ rm tests/handler.test.js
Update the serverless.yml
We are going to use a different service name.
serverless.yml and find the following line:
And replace it with this:
The reason we are doing this is because Serverless Framework uses the
service name to identify projects. Since we are creating a new project we want to ensure that we use a different name from the original. Now we could have simply overwritten the existing project but the resources were previously created by hand and will conflict when we try to create them through code.
Also, find this line in the
And replace it with:
We are defaulting the stage to
dev instead of
prod. This will become clear later when we create multiple environments.
Let’s quickly commit these changes.
$ git add . $ git commit -m "Organizing project"
Next let’s look into configuring our entire notes app backend via our
serverless.yml. This is commonly known as Infrastructure as code.
If you liked this post, please subscribe to our newsletter, give us a star on GitHub, and follow us on Twitter.
For help and discussionComments on this chapter