Still struggling with getting the Handler box in my AWS Lambda setup aligned with the function I want to call in my Clojurescript.. Kinda stumped.. It seems to indicate index.functionname in the hovertip.. My index.js file requires my clojurescript and it doesn’t see it.— if I use my out\myfile.js file instead it finds the file but fails to find goog..
Are you also using the web GUI in the lambda web app instead of the tools to set the file?
and Handler
or just the configuration tools?
I have been using the webGui to upload the zip file and set the handler
If you create a node handler, can you check it vs this?
like node hellow world?
This took a good amount of time to get right in the JVM tooling, just offereing suggestions of stuff that helped. I didn’t do Cljs (but am curious about the platform to avoid the JVM cold starts)
I have been looking for a raw simple “hello world style” lambda cljs function to play with, but most of them seem significantly more complex than that.. I am new to node.js so I am not positive that I have this configured right either. It runs on the node command line..
Ahh, that mix is rough
@fingertoe does the example in https://github.com/nervous-systems/cljs-lambda work?
A lot of the examples on the JVM side didn’t work for me
and so I had to find the working ones, and go sideways from those because very little feedback or doc at the lambda layer
I started there — It seems way overkill for what I am trying to do however. I don’t think I need core.async etc - I just want to return a randomized sequence on demand from an Amazone Alexa request..
If I figure it out perhaps my next project should be “Build it in Klipse and export to lambda” That would be dandy..
I think I am on the right track now — I need a line like: (set! (.-exports js/module) #js {:newgame #((Somefunction))}) In my code to create the export.. I am getting arity issues at compile time, but It seems to be what was missing.
I thought the ^:export should do the trick — but I don’t see any exports unless I use the (set!) thing.
What you’re going through right now is why I’m far more likely to use clojure than clojurescript for stuff like this. When You’re done I’d love to see the vid/notes/gist on it
I made a video of the clojure side, and sample project if that’s ever of use
to you
Here is what is in my core.js module.exports = ({"newgame": (function (){ return jdrc960.core.newgame.call(null,(1),(2)); })}); I am back where I started - index.newgame in the Handler box says "{ "errorMessage": "Handler 'newgame' missing on module 'index'” } If I go straight to the included out/jdrc960/core.newgame in the handler box I get "errorMessage": "goog is not defined”, Seems to be a namespace issue. really it should be jdrc960.core/newgame but Amazon’s handler box doesn’t seem to know how to parse that deep.
are you running this via the test harness?
No. Just uploading the zip file and running it from lambda web console.