Bonsai.AbstractHandler
— TypeHas a field fn which takes stream as it's first argument
fn(stream, ...)
Bonsai.@composite
— Macro[action-img]: https://github.com/onetonfoot/Bonsai.jl/actions/workflows/ci.yaml/badge.svg [action-url]: https://github.com/onetonfoot/Bonsai.jl/actions
This project is still in early development and likely to change pre 1.0
Installation
]add Bonsai
Documentation
A quick example
using Bonsai, HTTP
const app = App()
function index(stream::HTTP.Stream)
query = Bonsai.read( stream, Query(name=Union{String, Nothing}))
name = isnothing(query.name) ? "John Doe" : query.name
Bonsai.write(stream, Body("Hi, $name"))
end
app.get["/"] = index
start(app, port=9091)
For usage please see the documentation