Fork me on GitHub
#aws-lambda
<
2016-09-22
>
fingertoe06:09:45

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..

mj_langford14:09:38

Are you also using the web GUI in the lambda web app instead of the tools to set the file?

mj_langford14:09:49

or just the configuration tools?

fingertoe15:09:35

I have been using the webGui to upload the zip file and set the handler

mj_langford15:09:12

If you create a node handler, can you check it vs this?

mj_langford15:09:20

like node hellow world?

mj_langford15:09:13

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)

fingertoe15:09:01

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..

mj_langford15:09:00

Ahh, that mix is rough

mj_langford15:09:32

A lot of the examples on the JVM side didn’t work for me

mj_langford15:09:00

and so I had to find the working ones, and go sideways from those because very little feedback or doc at the lambda layer

fingertoe16:09:55

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..

fingertoe16:09:14

If I figure it out perhaps my next project should be “Build it in Klipse and export to lambda” That would be dandy..

fingertoe16:09:50

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.

fingertoe16:09:54

I thought the ^:export should do the trick — but I don’t see any exports unless I use the (set!) thing.

mj_langford17:09:02

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

mj_langford17:09:22

I made a video of the clojure side, and sample project if that’s ever of use

fingertoe17:09:57

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.

mj_langford19:09:14

are you running this via the test harness?

fingertoe23:09:51

No. Just uploading the zip file and running it from lambda web console.