Make a code change

While the app is still running, open the file sam-app/HelloWorld/Function.cs and make a simple code change. For example, change the response message to return hello my friend instead of hello world. Your Lambda handler should look like this after the change:


Note: Make sure you save the file after changing it.

Because C# is a compiled language, you need to Ctrl-C to stop the sam local process, re-build, and restart the sam local process.

sam build
sam local start-api --port 8080

Refresh the browser tab or re-trigger the curl command to see the changes reflected in your endpoint. SamLocalCodeChange