Making it easier to write OpenWhisk functions using ClojureScript
This is a very small library that is intended to do two things:
- wrap your ClojureScript code, so that it can be executed in OpenWhisk's Node.js runtime
- make some of the functions of the OpenWhisk npm package available in ClojureScript
[trieloff/clojurescript-openwhisk "0.1.1"]
(:require [openwhisk.wrap :as o])
(defn echo [params]
(identity params))
(o/wrapfn echo)
(defproject myproject "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojurescript "1.9.521" :exclusions [org.apache.ant/ant]]
[trieloff/clojurescript-openwhisk "0.1.0"]
[org.clojure/clojure "1.8.0"]]
:plugins [[lein-cljsbuild "1.1.6"]]
:clean-targets ^{:protect false} ["target", "main.js"]
:hooks [leiningen.cljsbuild]
:cljsbuild {
:builds [{:id "server"
:source-paths ["src/cljs"]
:jar true
:compiler {:main mypriject.core
:output-to "main.js"
:language-in :ecmascript5
:language-out :ecmascript5
:pretty-print true
:closure-output-charset "US-ASCII"
:hashbang false
:optimizations :simple ;; notice this!
:target :nodejs }}]})
Then run lein compile
to build, and deploy the resulting main.js
to OpenWhisk.
The :closure-output-charset
is set to "US-ASCII" to work around an encoding shortcut in the Google Closure compiler that is causing interoperability challenges in OpenWhisk.
- Lanyrd-Embed – Adding OEmbed Support for Lanyrd