Serverless Applications with Node.js: Using AWS Lambda and Claudia.js
Summary

Serverless Applications with Node.js walks you through building serverless apps on AWS using JavaScript. Inside, you'll discover what Claudia.js brings to the table as you build and deploy a scalable event-based serverless application, based around a pizzeria that's fully integrated with AWS services, including Lambda and API Gateway. Each chapter is filled with exercises, examples, tips, and more to make sure you're ready to bring what you've learned into your own work.

Foreword by Gojko Adzic.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

The benefits of cloud-hosted serverless web apps are undeniable: lower complexity, quicker time to market, and easier scalability than traditional, server-dependent designs. And thanks to JavaScript support in AWS Lambda and powerful new serverless API tools like the Claudia.js library, you can build and deploy serverless apps end to end without learning a new language.

About the Book

Serverless Applications with Node.js teaches you to design and build serverless web apps on AWS using JavaScript, Node, and Claudia.js. You'll master the basics of writing AWS Lambda functions, along with core serverless patterns like API Gateway. Along the way, you'll practice your new skills by building a working chatbot and a voice assistant with Amazon Alexa. You'll also discover techniques for migrating existing apps to a serverless platform.

What's inside

  • Authentication and database storage
  • Asynchronous functions
  • Interesting real-world examples
  • Developing serverless microservices

About the Reader

For web developers comfortable with JavaScript and Node.js.

About the Author

Slobodan Stojanović and Aleksandar Simović are AWS Serverless Heroes and core contributors to the Claudia.js project. They are also coauthors of Desole, an open source serverless errortracking tool, and the lead developers of Claudia Bot Builder.

Table of Contents

    PART 1 - Serverless pizzeria
  1. Introduction to serverless with Claudia
  2. Building your first serverless API
  3. Asynchronous work is easy, we Promise()
  4. Pizza delivery: Connecting an external service
  5. Houston, we have a problem!
  6. Level up your API
  7. Working with files
  8. PART 2 - Let's talk
  9. When pizza is one message away: Chatbots
  10. Typing... Async and delayed responses
  11. Jarvis, I mean Alexa, order me a pizza
  12. Paying for pizza
  13. Migrating to serverless
  14. Real-world case studies
  15. appendix A - Installation and configuration
  16. appendix B - Facebook Messenger, Twilio, and Alexa configuration
  17. appendix C - Stripe and MongoDB setup
  18. appendix D - The pizza recipe
1135862497
Serverless Applications with Node.js: Using AWS Lambda and Claudia.js
Summary

Serverless Applications with Node.js walks you through building serverless apps on AWS using JavaScript. Inside, you'll discover what Claudia.js brings to the table as you build and deploy a scalable event-based serverless application, based around a pizzeria that's fully integrated with AWS services, including Lambda and API Gateway. Each chapter is filled with exercises, examples, tips, and more to make sure you're ready to bring what you've learned into your own work.

Foreword by Gojko Adzic.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

The benefits of cloud-hosted serverless web apps are undeniable: lower complexity, quicker time to market, and easier scalability than traditional, server-dependent designs. And thanks to JavaScript support in AWS Lambda and powerful new serverless API tools like the Claudia.js library, you can build and deploy serverless apps end to end without learning a new language.

About the Book

Serverless Applications with Node.js teaches you to design and build serverless web apps on AWS using JavaScript, Node, and Claudia.js. You'll master the basics of writing AWS Lambda functions, along with core serverless patterns like API Gateway. Along the way, you'll practice your new skills by building a working chatbot and a voice assistant with Amazon Alexa. You'll also discover techniques for migrating existing apps to a serverless platform.

What's inside

  • Authentication and database storage
  • Asynchronous functions
  • Interesting real-world examples
  • Developing serverless microservices

About the Reader

For web developers comfortable with JavaScript and Node.js.

About the Author

Slobodan Stojanović and Aleksandar Simović are AWS Serverless Heroes and core contributors to the Claudia.js project. They are also coauthors of Desole, an open source serverless errortracking tool, and the lead developers of Claudia Bot Builder.

Table of Contents

    PART 1 - Serverless pizzeria
  1. Introduction to serverless with Claudia
  2. Building your first serverless API
  3. Asynchronous work is easy, we Promise()
  4. Pizza delivery: Connecting an external service
  5. Houston, we have a problem!
  6. Level up your API
  7. Working with files
  8. PART 2 - Let's talk
  9. When pizza is one message away: Chatbots
  10. Typing... Async and delayed responses
  11. Jarvis, I mean Alexa, order me a pizza
  12. Paying for pizza
  13. Migrating to serverless
  14. Real-world case studies
  15. appendix A - Installation and configuration
  16. appendix B - Facebook Messenger, Twilio, and Alexa configuration
  17. appendix C - Stripe and MongoDB setup
  18. appendix D - The pizza recipe
34.99 In Stock
Serverless Applications with Node.js: Using AWS Lambda and Claudia.js

Serverless Applications with Node.js: Using AWS Lambda and Claudia.js

Serverless Applications with Node.js: Using AWS Lambda and Claudia.js

Serverless Applications with Node.js: Using AWS Lambda and Claudia.js

eBook

$34.99 

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Summary

Serverless Applications with Node.js walks you through building serverless apps on AWS using JavaScript. Inside, you'll discover what Claudia.js brings to the table as you build and deploy a scalable event-based serverless application, based around a pizzeria that's fully integrated with AWS services, including Lambda and API Gateway. Each chapter is filled with exercises, examples, tips, and more to make sure you're ready to bring what you've learned into your own work.

Foreword by Gojko Adzic.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Technology

The benefits of cloud-hosted serverless web apps are undeniable: lower complexity, quicker time to market, and easier scalability than traditional, server-dependent designs. And thanks to JavaScript support in AWS Lambda and powerful new serverless API tools like the Claudia.js library, you can build and deploy serverless apps end to end without learning a new language.

About the Book

Serverless Applications with Node.js teaches you to design and build serverless web apps on AWS using JavaScript, Node, and Claudia.js. You'll master the basics of writing AWS Lambda functions, along with core serverless patterns like API Gateway. Along the way, you'll practice your new skills by building a working chatbot and a voice assistant with Amazon Alexa. You'll also discover techniques for migrating existing apps to a serverless platform.

What's inside

  • Authentication and database storage
  • Asynchronous functions
  • Interesting real-world examples
  • Developing serverless microservices

About the Reader

For web developers comfortable with JavaScript and Node.js.

About the Author

Slobodan Stojanović and Aleksandar Simović are AWS Serverless Heroes and core contributors to the Claudia.js project. They are also coauthors of Desole, an open source serverless errortracking tool, and the lead developers of Claudia Bot Builder.

Table of Contents

    PART 1 - Serverless pizzeria
  1. Introduction to serverless with Claudia
  2. Building your first serverless API
  3. Asynchronous work is easy, we Promise()
  4. Pizza delivery: Connecting an external service
  5. Houston, we have a problem!
  6. Level up your API
  7. Working with files
  8. PART 2 - Let's talk
  9. When pizza is one message away: Chatbots
  10. Typing... Async and delayed responses
  11. Jarvis, I mean Alexa, order me a pizza
  12. Paying for pizza
  13. Migrating to serverless
  14. Real-world case studies
  15. appendix A - Installation and configuration
  16. appendix B - Facebook Messenger, Twilio, and Alexa configuration
  17. appendix C - Stripe and MongoDB setup
  18. appendix D - The pizza recipe

Product Details

ISBN-13: 9781638356172
Publisher: Manning
Publication date: 02/12/2019
Sold by: SIMON & SCHUSTER
Format: eBook
Pages: 352
File size: 29 MB
Note: This product may take a few minutes to download.

About the Author

Slobodan Stojanovic is CTO of Cloud Horizon, a software development studio based in Montreal Canada, and JS Belgrade meetups co-organizer. He is involved with a few open source projects, including Claudia.js. He is also a conference speaker.

Aleksandar Simovic is a consultant and engineer, working mostly for large Swiss insurance companies. He is one of the co-organizers of JS Belgrade, one of the biggest JavaScript communities in South Europe. Aleksandar is a conference speaker and on

Table of Contents

Preface xi

Acknowledgments xiii

About this book xv

About the authors xix

About the cover illustration xx

Part 1 Serverless Pizzeria 1

1 Introduction to serverless with Claudia 3

1.1 Servers and washing machines 4

1.2 The core concepts 5

1.3 How does serverless work? 6

1.4 Serverless in practice 6

Aunt Maria's serverless pizzeria 7

A common approach 7

Serverless approach 9

1.5 Serverless infrastructure - AWS 9

1.6 What is Claudia, and how does it fit? 14

1.7 When and where you should use it 16

2 Building your first serverless API 19

2.1 Assembling pizza ingredients: building the API 19

Which pizza can I GET? 22

Structuring your API 25

POSTing an order 30

2.2 How Claudia deploys your API 34

2.3 Traffic control: How API Gateway works 35

2.4 When a serverless API is not the solution 36

2.5 Taste it! 37

Exercise 37

Solution 37

Asynchronous work is easy, we Promise() 42

3.1 Storing the orders 43

3.2 Promising to deliver in less than 30 minutes! 48

3.3 Trying out your API 51

3.4 Getting orders from the database 55

3.5 Taste it! 57

Exercise 57

Solution 58

4 A Pizza delivery: Connecting an external service 62

4.1 Connecting to an external service 63

4.2 Connecting to the delivery API 64

The Some Like It Hot Delivery API 64

Creating your first delivery request 65

4.3 Potential issues with async communication 71

Forgetting to return a promise 72

Not passing the value from the promise 73

Not wrapping the external service in a promise 73

Timeout issues with long async operations 74

4.4 Taste it! 76

Exercise 76

Solution 77

5 Houston, we have a problem! 80

5.1 Debugging a serverless app 81

5.2 Debugging your Lambda function 82

5.3 X-Ray your app 85

5.4 Taste it! 88

Exercise 88

Solution 88

6 Level up your API 90

6.1 Serverless authentication and authorization 91

6.2 Creating user and identity pools 94

Controlling API access with Cognito 97

6.3 Taste it! 101

Exercise 101

Solution 101

7 Working with files 104

7.1 Storing static files in a serverless application 104

7.2 Generating thumbnails 108

Deploying your S3 function 114

7.3 Taste it! 116

Exercise 116

Solution 116

7.4 End of part 1: Special exercise 118

Advanced task 118

Part 2 Let's Talk 121

8 When pizza is one message away: Chatbots 123

8.1 Pizza ordering beyond the browser 123

8.2 Hello from Facebook Messenger 124

8.3 What kinds of pizzas do you have? 128

8.4 Speeding up the deployment 130

8.5 Messenger templates 131

8.6 How does Claudia Bot Builder work? 134

8.7 Taste it! 136

Exercise 136

Solution 136

9 Typing… Async and delayed responses 138

9.1 Making chatbots interactive 139

Tap to order: answering a postback 139

9.2 Making the chatbot structure more scalable 145

9.3 Connecting your chatbot to the DynamoDB database 149

9.4 Getting the user's location from the chatbot 153

9.5 Scheduling a delivery 156

9.6 Small talk: Integrating simple NLP 161

9.7 Taste it! 163

Exercise 163

Solution 163

Advanced exercise 165

10 Jarvis, I mean Alexa, order me a pizza 166

10.1 Can't talk right now: sending an SMS with Twilio 167

An SMS pizza list 169

Ordering a pizza 170

10.2 Hey Alexa! 175

Preparing the skill 179

Ordering pizza with Alexa 183

10.3 Taste it! 187

Exercise 187

Solution 187

10.4 End of part 2: special exercise 188

Part 3 Next Steps 189

11 Testing, Testing, 1,2,3 191

11.1 Testing server-hosted and serverless applications 191

11.2 How to approach testing serverless applications 193

11.3 Preparation 194

11.4 Unit tests 197

11.5 Mocking your serverless functions 201

11.6 Integration tests 207

11.7 Other types of automated testing 211

11.8 A step bevond: Writing testable serverless functions 212

11.9 Taste it! 216

Exercise 216

Solution 217

12 Paying for pizza 219

12.1 Payment transactions 220

Implementing an online payment 221

12.2 Implementing your payment service 225

12.3 Could someone hack your payment service? 231

Standards 231

Competence 232

12.4 Taste it! 232

Exercise 232

Solution 233

13 Migrating your existing Expresses app to AWS Lambda 235

13.1 Uncle Roberto's taxi application 236

13.2 Running an Express.js application in AWS Lambda 236

Proxy integration 239

How serverless-express works 239

13.3 Serving static content 240

13.4 Connecting to MongoDB 242

Using a managed MongoDB database with your serverless Express.js app 243

13.5 Limitations of serverless Express.js applications 248

13.6 Taste it! 249

Exercise 249

Solution 249

14 A Migrating to serverless 251

14.1 Analyzing your current serverless application 252

14.2 Migrating your existing application to serverless 252

14.3 Embrace the platform 256

Serving static files 256

Storing state 256

Logs 257

Continuous integration 258

Managing environments: production and development 259

Sharing secrets 260

VPC (Virtual Private Cloud) 262

14.4 Optimizing your application 263

Bundled or single-purpose functions 263

Choosing the right memory size for your Lambda junction 263

14.5 Facing the challenges 264

Handling timeouts 264

Cold starts 265

DDoS attacks 266

Vendor lock-in 267

14.6 Taste it! 268

15 Real-world case studies 269

15.1 CodePen 270

Before serverless 270

Serverless migration 271

Cost of the infrastructure 273

Testing and challenges 274

15.2 MindMup 275

Before serverless 275

Serverless migration 276

Cost of the infrastructure 278

Testing, logs, and challenges 280

Appendix A Installation and configuration 283

Appendix B Facebook Messenger, Twilio, and Alexa configuration 289

Appendix C Stripe and MongoDB setup 311

Appendix D The pizza recipe 321

Index 323

From the B&N Reads Blog

Customer Reviews