Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Serverless Computing with Google Cloud

You're reading from   Hands-On Serverless Computing with Google Cloud Build, deploy, and containerize apps using Cloud Functions, Cloud Run, and cloud-native technologies

Arrow left icon
Product type Paperback
Published in Feb 2020
Publisher Packt
ISBN-13 9781838827991
Length 320 pages
Edition 1st Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Richard Rose Richard Rose
Author Profile Icon Richard Rose
Richard Rose
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: App Engine
2. Introducing App Engine FREE CHAPTER 3. Developing with App Engine 4. Section 2: Google Cloud Functions
5. Introducing Lightweight Functions 6. Developing Cloud Functions 7. Exploring Functions as a Service 8. Cloud Functions Labs 9. Section 3: Google Cloud Run
10. Introducing Cloud Run 11. Developing with Cloud Run 12. Developing with Cloud Run for Anthos 13. Cloud Run Labs 14. Section 4: Building a Serverless Workload
15. Building a PDF Conversion Service 16. Consuming Third-Party Data via a REST API 17. Assessments 18. Other Books You May Enjoy

Creating a simple web application

Now that we know how to build and deploy a container on Cloud Run on GKE, the next step is to explore how to link this together with other services to create an application. With our application deployed on GKE, we now need to configure Cloud Storage and Cloud Pub/Sub.

For our example, we are going to build a form to call our announce service:

  1. Create a new directory called simple-form:
mkdir simple-form && cd $_
  1. Initialize the environment:
npm init --yes
  1. Edit the package.json file and add the start command:
…
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
...
  1. Install the npm packages (pug and express):
npm install pug
npm install express
In the following code, we will call our announce-service:1.0. Replace the service...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime