A micro web framework for Väja.
import Bob
let app = \
Bob.new() \
|> Bob.addMiddlewares([Bob.debugMiddleware, Bob.rendererMiddleware]) \
|> Bob.addRoute404(fn(conn, _) -> {"status": 404, "body": "Page not found"}) \
|> Bob.addRoutes([
[
Bob.newPath("/artist/([a-z]*)/"),
fn(_conn, args) -> Bob.newJSONResponse({"status": 200, "context": {
"artist": args[0]
}})
]
])
Http.createServer() \
|> Http.addHandler(
app |> Bob.makeHandler()
) \
|> Http.listen(8080)
This project is released under the MIT License.