We’re super excited to announce a new Livebook release!
This one comes with a big new feature we’ve been working on: Kino.Proxy
.
By using Kino.Proxy
, you can now expose API endpoints directly from your notebook or Livebook app.
Here’s a Hello World example:
Kino.Proxy.listen(fn conn ->
Plug.Conn.send_resp(conn, 200, "hello world!")
end)
(Noticed it’s just a Plug?! )
When you do that, Livebook will start proxying requests at the following paths:
/proxy/sessions/:id/*path
- a notebook session/proxy/apps/:slug/sessions/:session_id/*path
- a specific app session/proxy/apps/:slug/*path
- generic app path, only supported for single-session apps. If the app has automatic shutdowns enabled and it is not currently running, it will be automatically started
We believe that APIs with Kino.Proxy
open Livebook to a new category of use cases.
For example, you can quickly build an API that receives a request from Zapier to automate internal processes.
Here’s the announcement blog post: Livebook 0.13: expose an HTTP API from your notebook - Livebook.dev - The Livebook Blog
And here’s the docs: Kino.Proxy — Kino v0.13.2