Created
January 17, 2022 15:22
-
-
Save jackrusher/1cc61e0ca0e929b9ec21bf4407af6d75 to your computer and use it in GitHub Desktop.
Writing and deploying Google Cloud Functions in Clojure using NBB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# command line to deploy the project | |
gcloud functions deploy hello --runtime nodejs14 --trigger-http |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns hello) | |
(defn hello [req res] | |
(js/console.log req) | |
(.send res "hello world")) | |
#js {:hello hello} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { loadFile } from 'nbb'; | |
const { hello } = await loadFile('./hello.cljs'); | |
export { hello } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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