Join Troy Miles for an in-depth discussion in this video Running Lambda locally , part of Developing AWS Lambda Functions with Kotlin.
- [Instructor] To enable our app to run locally…we must give it a main method.…Now we aren't going to bring back…a stand alone class or object that has a main function.…That might work, but it would result…in duplicate code, which isn't good.…Instead, we will add a companion object…to the lamda handler class.…A companion object is similar to a static class in Java.…Then we move a few variables and the define routes…methods into the companion object.…We finish by adding a main method.…So we're going to move the cursor up to right about here,…we are going to say companion object…and right now we're just going to take this closing brace,…take it out of there, move it all the way down to the bottom…and put it right there.…
Do a command option L to reformat our code…and get rid of these unnecessary empty lines.…Now we can see that we have a few errors floating around.…One of them is because the log function…is no longer in the companion object.…We're going to cut it form here and bring it to here.…Now the other thing that we need to do…
- Creating an AWS Lambda account
- Creating a simple Lambda function in Node.js
- Testing the Lambda function
- Creating Kotlin apps with Spark, IntelliJ IDEA, Maven, and the AWS library
- Binding the API gateway to your Lambda function
- Adding data with MongoDB
- Developing and debugging your Lambda function locally
Skill Level Intermediate
1. About AWS Lambda
2. Hello Lambda
3. Hello Kotlin Lambda
4. Making Your Lambda Web Visible
5. Adding Data with MongoDB
6. Developing and Debugging Locally
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.