---
title: Creating an API using Cloud Functions with Node.js
description: "Solved: Streamline API setup with Cloud Run's versatility. Leverage Express.js for efficient mobile app integration."
image: https://www.c2cglobal.com/hubfs/Article%20Images/Creating%20an%20API%20using%20Cloud%20Functions%20%28Node.js%29.jpeg.jpg
---

[![c2c logo blue](https://www.c2cglobal.com/hubfs/c2c-logo-blue.svg "c2c logo blue")](https://www.c2cglobal.com/)

[Infrastructure](https://www.c2cglobal.com/articles/tag/infrastructure), [Application Development](https://www.c2cglobal.com/articles/tag/application-development), [API Management](https://www.c2cglobal.com/articles/tag/api-management), [Getting Started with Google Cloud](https://www.c2cglobal.com/articles/tag/getting-started-with-google-cloud), [Cloud Operations](https://www.c2cglobal.com/articles/tag/cloud-operations)

# Creating an API using Cloud Functions (Node.js)

By [David Ressler](https://www.c2cglobal.com/articles/author/david-ressler) | January 26, 2022

I am currently evaluating different Google Cloud products in trying to set up an API for developers to use in a mobile app.

 

How should I evaluate thinking between:

- A single Cloud Function using Express.js to create multiple routes in an API (accessed via API Gateway), vs.
- A single Cloud Function **per** API endpoint (accessed via API Gateway)

 

**Best answer by yuval**

Hello [@davidressler](https://community.c2cglobal.com/members/mid-17523) 

Cloud Functions are based on Cloud Run. I like Cloud Run because you can build and run your own containers instead of having to think about supported environments in Cloud Functions.

Read “Getting started with API Gateway and Cloud Run”\[1\].

Regarding single Cloud Run service for multiple methods vs multiple Cloud Run services - consider resources usage by different methods, if you have a method that uses more memory or it is CPU intensive you might want to separate it to a different Cloud Run service with larger container size. You might want different scaling for different methods. You can also run each Cloud Run service using a separate service account with different roles - one service needs only permission to write to a specific GCS bucket and another needs permission to read a secret from Google Secret Manager.

 

\[1\] [https://cloud.google.com/api-gateway/docs/get-started-cloud-run](https://cloud.google.com/api-gateway/docs/get-started-cloud-run)

 

---

## Recent Articles

<https://www.c2cglobal.com/articles/generative-ai-are-you-behind>

[Data Analytics](https://www.c2cglobal.com/articles/tag/data-analytics)

## [Generative AI: Are You Behind?!](https://www.c2cglobal.com/articles/generative-ai-are-you-behind)

Review the latest insights from the AI Readiness Report.

By Bruno Aziza

<https://www.c2cglobal.com/articles/make-gen-ai-work-landscape-slms-vs.-llms-cost-more>

[Industry Solutions](https://www.c2cglobal.com/articles/tag/industry-solutions)

## [Make "Gen AI Work": Landscape, SLMs vs. LLMs, Cost & More...](https://www.c2cglobal.com/articles/make-gen-ai-work-landscape-slms-vs.-llms-cost-more)

Discover the 5 metrics you need to know in order to be an exceptional CEO and Operator.

By Bruno Aziza

<https://www.c2cglobal.com/articles/ai-cheat-sheet>

[Google Cloud Strategy](https://www.c2cglobal.com/articles/tag/google-cloud-strategy)

## [AI Cheat Sheet](https://www.c2cglobal.com/articles/ai-cheat-sheet)

AI is no more and no less the drive to create robots with human minds so they can do everything we do and more. Use this cheat sheet to help decode the space.

By Leah Zitter

## Subscribe to our newsletter

Get the latest from C2C, direct to your inbox.

[Subscribe](https://share.hsforms.com/1znKGo6ySS9uaRyvLQQzxRw4qbyr)

![c2c-logo-white-tagline](https://www.c2cglobal.com/hubfs/c2c-logo-white-tagline.svg "c2c-logo-white-tagline")

C2C is the only peer-to-peer community built to support, connect, and educate Google Cloud customers across regions and industries so they can better harness the power of the cloud—and each other—to solve their biggest challenges and drive innovation.

©2024  C2C Global. All rights reserved. [Privacy Policy](https://www.c2cglobal.com/privacy)

20 N Wacker Drive • Suite 1810 • Chicago, IL • 60606

**Join over 60K members on C2C.**

Let's connect!

- [mailto:hello@c2cglobal.com](mailto:hello@c2cglobal.com)
- <https://m.youtube.com/channel/UCWOli-_qQyZziBdPQ-6p-eQ>
- <https://www.linkedin.com/company/66934702>
- [![X](https://www.c2cglobal.com/hubfs/twitter-x-icon-white.svg)](https://twitter.com/MeetC2C)

![](https://px.ads.linkedin.com/collect/?pid=2634489&fmt=gif)