aws-lambda

fingertoe 2016-09-22T06:20:45.000042Z

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_langford 2016-09-22T14:33:38.000043Z

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

mj_langford 2016-09-22T14:33:42.000044Z

and Handler

mj_langford 2016-09-22T14:33:49.000045Z

or just the configuration tools?

fingertoe 2016-09-22T15:16:35.000046Z

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

mj_langford 2016-09-22T15:17:12.000047Z

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

mj_langford 2016-09-22T15:17:20.000048Z

like node hellow world?

mj_langford 2016-09-22T15:18:13.000049Z

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)

fingertoe 2016-09-22T15:42:01.000050Z

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_langford 2016-09-22T15:51:00.000051Z

Ahh, that mix is rough

mj_langford 2016-09-22T15:52:13.000052Z

@fingertoe does the example in https://github.com/nervous-systems/cljs-lambda work?

mj_langford 2016-09-22T15:52:32.000054Z

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

mj_langford 2016-09-22T15:53:00.000055Z

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

fingertoe 2016-09-22T16:04:55.000056Z

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

fingertoe 2016-09-22T16:06:14.000057Z

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

fingertoe 2016-09-22T16:43:50.000058Z

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.

fingertoe 2016-09-22T16:50:54.000059Z

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

mj_langford 2016-09-22T17:01:02.000060Z

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_langford 2016-09-22T17:01:22.000061Z

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

mj_langford 2016-09-22T17:01:23.000062Z

to you

fingertoe 2016-09-22T17:22:57.000063Z

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_langford 2016-09-22T19:57:14.000064Z

are you running this via the test harness?

fingertoe 2016-09-22T23:47:51.000065Z

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