Skip to content

Instantly share code, notes, and snippets.

@jackrusher
Created January 17, 2022 15:22
Show Gist options
  • Save jackrusher/1cc61e0ca0e929b9ec21bf4407af6d75 to your computer and use it in GitHub Desktop.
Save jackrusher/1cc61e0ca0e929b9ec21bf4407af6d75 to your computer and use it in GitHub Desktop.
Writing and deploying Google Cloud Functions in Clojure using NBB
# command line to deploy the project
gcloud functions deploy hello --runtime nodejs14 --trigger-http
(ns hello)
(defn hello [req res]
(js/console.log req)
(.send res "hello world"))
#js {:hello hello}
import { loadFile } from 'nbb';
const { hello } = await loadFile('./hello.cljs');
export { hello }
{
"type": "module",
"scripts": {
"start": "functions-framework --target=hello"
},
"main": "index.mjs",
"dependencies": {
"nbb": "0.1.1",
"@google-cloud/functions-framework": "~1.9.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment