Skip to content

Instantly share code, notes, and snippets.

@borkdude
Forked from jackrusher/deploy.sh
Created March 18, 2022 11:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save borkdude/434642ee27d14497e397171662915b44 to your computer and use it in GitHub Desktop.
Save borkdude/434642ee27d14497e397171662915b44 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