function decide(request)
return iocaine.decision.Passthrough("foo")
end
❯ cargo run -- runtime decide
Anarchism("foo")
Awoo!
function decide(request)
return iocaine.decision.Passthrough("foo")
end
❯ cargo run -- runtime decide
Anarchism("foo")
Awoo!
Meanwhile, thinking about how to name the configuration module, I though of pillowtalk.
Hah, the first bullshit generator binding was a bit of a pain, the second one was a breeze.
Marvel at this beautiful thing!
function output(request, decision)
local rng = iocaine.generators.rng:from_seed(request.path);
local fjdata = iocaine.file.read("tmp/fakejpeg.msgpack");
local fj = iocaine.generators.FakeJpeg(fjdata);
local body = fj:generate(rng)
local response = iocaine.http.Response(body);
response:set_header("content-type", "image/jpeg")
return response
end
This is the kind of image that looks better blurred.
Mkay, most garbage generators have Lua bindings now. They're not good, but they more or less work.
But it turns out, I coded the template support very Roto-bound, so I have to rethink how I do the context handling.
Mkay, I have a.. kind of workaround. Now the trouble is figuring out how to translate a Lua values to Upon. Tables, in particular, are a problem, because in Lua, there are no separate types for List and Table. A list is simply an integer-indexed table.
There we go, that's mostly taken care of too.
Now another pass for error handling, because I'm returning a lot of runtime errors that should be more gracefully handled instead.
Mppfngh. Bindings are boring, but I'm like... halfway through!