{"id":15392672,"url":"https://github.com/jackdbd/hello-cloud-functions-cljs","last_synced_at":"2026-04-25T09:02:22.939Z","repository":{"id":82381052,"uuid":"540449505","full_name":"jackdbd/hello-cloud-functions-cljs","owner":"jackdbd","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-24T13:25:36.000Z","size":446,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T06:49:20.085Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackdbd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-09-23T13:19:47.000Z","updated_at":"2022-09-23T13:20:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"9174566f-7369-4395-9ccc-3455231681ba","html_url":"https://github.com/jackdbd/hello-cloud-functions-cljs","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"adc0c2d4f327057407735e5b8b33a20eb6912d70"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackdbd/hello-cloud-functions-cljs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fhello-cloud-functions-cljs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fhello-cloud-functions-cljs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fhello-cloud-functions-cljs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fhello-cloud-functions-cljs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackdbd","download_url":"https://codeload.github.com/jackdbd/hello-cloud-functions-cljs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fhello-cloud-functions-cljs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32256217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T04:23:17.126Z","status":"ssl_error","status_checked_at":"2026-04-25T04:21:53.360Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-01T15:15:38.835Z","updated_at":"2026-04-25T09:02:22.910Z","avatar_url":"https://github.com/jackdbd.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello-cloud-functions-cljs\n\n[Nbb](https://github.com/babashka/nbb) on Google Cloud Functions 2nd generation.\n\n## Installation\n\n```sh\nnpm install\n```\n\n## Test\n\n### Integration tests\n\nRun integration tests with [SuperTest](https://github.com/visionmedia/supertest) and [Jest](https://github.com/facebook/jest):\n\n```sh\nnpm run test\n```\n\n## Development\n\n### Invoke the function locally\n\nIn one terminal, start the function:\n\n```sh\nnpm run start:development\n```\n\nIn another terminal, call the function with curl, Postman, etc:\n\n```sh\ncurl -X POST \\\n-L \"$FUNCTION_URL\" \\\n-H \"Content-Type: application/json\" \\\n--data-raw '{\n    \"text\": \"Hello world in \u003cb\u003ebold\u003c/b\u003e and \u003ci\u003eitalic\u003c/i\u003e\"\n}'\n```\n\nNote: here `FUNCTION_URL` is `http://localhost:PORT` (e.g. `http://localhost:3000`).\n\n## Deploy\n\nIn order to deploy the function you will need the [gcloud CLI](https://cloud.google.com/sdk/docs/install). You will also need [Babashka](https://github.com/babashka/babashka) if you want to deploy the function using the Babashka task `deploy`.\n\n```sh\n# using a npm script\nnpm run deploy\n\n# or, using a Babashka task\nbb run deploy\n```\n\n### Invoke the function deployed to GCP Cloud Functions\n\nIf you want to test the function with curl (or Postman, etc) don't forget to include the identity token in the `Authorization` header.\n\nIf you invoke the function without the `Authorization` header, [Google Front End](https://cloud.google.com/docs/security/infrastructure/design#google_front_end_service) will block your request and return you a HTTP 403:\n\n```sh\ncurl -X POST \\\n-i \\\n-L \"$FUNCTION_URL\" \\\n-H \"Content-Type: application/json\" \\\n--data-raw '{\n    \"text\": \"This is a message sent by \u003cb\u003ecurl\u003c/b\u003e\"\n}'\n```\n\nYou can make an authenticated request using any account which is authorized to invoke that function.\n\nHere is how you can make an authenticated request using the **user account** you are currently logged in:\n\n```sh\ncurl -X POST \\\n-L \"$FUNCTION_URL\" \\\n-H \"Authorization: Bearer $(gcloud auth print-identity-token)\" \\\n-H \"Content-Type: application/json\" \\\n--data-raw '{\n    \"text\": \"This is a message sent by \u003cb\u003ecurl\u003c/b\u003e\"\n}'\n```\n\nNote: here `FUNCTION_URL` is the [trigger URL](https://cloud.google.com/functions/docs/calling/http) of the function deployed to Cloud Functions (e.g. `https://hello-45eyyotfta-ey.a.run.app`).\n\nHere is how you can make an authenticated request using a **service account**, thanks to the [service account impersonation](https://cloud.google.com/iam/docs/impersonating-service-accounts) (the service account you impersonate must have the permissions to invoke the function):\n\n```sh\nID_TOKEN=$(gcloud auth print-identity-token --impersonate-service-account sa-notifier@prj-kitchen-sink.iam.gserviceaccount.com) \u0026\u0026\ncurl -X POST \\\n-L \"$FUNCTION_URL\" \\\n-H \"Authorization: Bearer $ID_TOKEN\" \\\n-H \"Content-Type: application/json\" \\\n--data-raw '{\n    \"text\": \"This is a message sent by \u003cb\u003ecurl\u003c/b\u003e\"\n}'\n```\n\n## See also\n\n- [Nbb on Google Cloud Functions (1st generation)](https://github.com/babashka/nbb/blob/main/doc/gcloud_functions.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fhello-cloud-functions-cljs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackdbd%2Fhello-cloud-functions-cljs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fhello-cloud-functions-cljs/lists"}