{"id":13998249,"url":"https://github.com/meteatamel/cloud-functions-api","last_synced_at":"2025-07-21T07:32:01.746Z","repository":{"id":85651956,"uuid":"455200135","full_name":"meteatamel/cloud-functions-api","owner":"meteatamel","description":"A sample that shows how to use API Gateway with Cloud Functions","archived":false,"fork":false,"pushed_at":"2022-02-23T12:55:16.000Z","size":43,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T13:19:02.042Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meteatamel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-03T14:37:25.000Z","updated_at":"2024-09-22T20:49:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c8275f3b-2c63-4fe9-a439-b5fa011228aa","html_url":"https://github.com/meteatamel/cloud-functions-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/meteatamel/cloud-functions-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteatamel%2Fcloud-functions-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteatamel%2Fcloud-functions-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteatamel%2Fcloud-functions-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteatamel%2Fcloud-functions-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meteatamel","download_url":"https://codeload.github.com/meteatamel/cloud-functions-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meteatamel%2Fcloud-functions-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266261121,"owners_count":23901284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-09T19:01:30.369Z","updated_at":"2025-07-21T07:32:01.714Z","avatar_url":"https://github.com/meteatamel.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# Cloud Functions API\n\nIn this sample, you will create an API with API Gateway where each path is\nhandled by a different Cloud Function.\n\n![API Gateway with Cloud Functions](image.png)\n\n## Cloud Functions\n\nWe'll deploy two simple functions defined in [index.js](index.js):\n\n```nodejs\nexports.helloWorld = (req, res) =\u003e {\n    res.send('Hello, World');\n};\n\nexports.byeWorld = (req, res) =\u003e {\n    res.send('Bye, World');\n};\n```\n\nDeploy both functions:\n\n```sh\n./1_deploy_functions.sh\n```\n\n## API Gateway\n\n### Create an API\n\nEnable required services for API Gateway and create a `greeter-api` API:\n\n```sh\n./2_create_api.sh\n```\n\n### Create an API config\n\nCreate an API config using the OpenAPI spec to define which path goes to which\nfunction.\n\nWe'll use [openapi2-functions.yaml](openapi2-functions.yaml) as a starter but replace `REGION` and\n`PROJECT_ID` with real values. This definition routes `/hello` to the\nhello function and `/bye` to the bye function.\n\n```sh\n./3_create_api_config.sh\n```\n\n### Create a gateway\n\nThe final step is to deploy the API config to a gateway:\n\n```sh\n./4_create_gateway.sh\n```\n\n## Test\n\nTo test the API, first fetch the default host name of the gateway and then make\na call with `/hello` and `/bye` paths:\n\n```sh\n./5_test_gateway.sh\n```\n\nYou should see something similar:\n\n```sh\n# Test hello\ncurl https://greeter-gateway-5dvbajef.ew.gateway.dev/hello\nHello, World\n# Test bye\ncurl https://greeter-gateway-5dvbajef.ew.gateway.dev/bye\nBye, World%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeteatamel%2Fcloud-functions-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeteatamel%2Fcloud-functions-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeteatamel%2Fcloud-functions-api/lists"}