Step#3: Let's Explore the Code and Make Few Changes

We will be just exploring the code generated by AWS CodeStar and making minor changes.

Let's Open the directory where we cloned this repository in a code editor. (please use the code editor of your choice)

First, you can see it already has a package.json file with few dependencies listed, This means we can easily use any npm module we want.

Let's edit the package.json file and update the description to Email and SMS Notification Service.

The directory also contains few other files, But we wont get into all these files in this tutorial.

If you open app.js file you can see some code there, If you have used Express earlier then this will easily make sense to you.

There are two methods GET and POST and they respond accordingly when we make API Requests.

For example: When we open our application url https://jbn1gx1p26.execute-api.us-east-1.amazonaws.com/Prod/ we see the message Hello World!

Lets edit the app.js file and let's change our app.get code to

app.get('/', function(req, res) { res.json({ code: 200, active: true, description: 'Notification Service.' }); });

After saving the changes, Let's commit our code., This will trigger our deployment process and once the process is completed, We can open https://jbn1gx1p26.execute-api.us-east-1.amazonaws.com/Prod/ and see the changes reflected there.

The deployment process is slow and takes some time (atleast for me it took some time), So please be patient.