livebook as api
This commit is contained in:
@@ -1,9 +1,24 @@
|
|||||||
# livebook api
|
# livebook api
|
||||||
|
|
||||||
|
```elixir
|
||||||
|
Mix.install([
|
||||||
|
{:kino, "~> 0.16.1"},
|
||||||
|
{:plug, "~> 1.18"}
|
||||||
|
])
|
||||||
|
```
|
||||||
|
|
||||||
## Section
|
## Section
|
||||||
|
|
||||||
https://news.livebook.dev/livebook-0.13-expose-an-http-api-from-your-notebook-2wE6GY
|
https://news.livebook.dev/livebook-0.13-expose-an-http-api-from-your-notebook-2wE6GY
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
|
Kino.Proxy.listen(fn conn ->
|
||||||
|
Plug.Conn.send_resp(conn, 200, "hello world!")
|
||||||
|
end)
|
||||||
|
```
|
||||||
|
|
||||||
|
replace ip address and port numbers of livebook server
|
||||||
|
|
||||||
```
|
```
|
||||||
|
curl -L "http://ipaddress:port/proxy/sessions/4gqhbukjeigg5ht4zphpi7gihyoyl247x2rhcs63nnsd2dyj"
|
||||||
|
```
|
||||||
|
Reference in New Issue
Block a user