A toy web framework for Carp
This is very much a proof of concept please don't use this for anything serious.
(load "https://github.com/TimDeve/[email protected]")
(use Koi)
(defn root-handler [req]
(Res.send (HttpStatus.Ok)
@"text/plain"
@"Hello from Carp!"))
(defn routes []
[(Route.init (HttpVerb.GET) @"/" root-handler)])
(defn main []
(serve "localhost" 8080 (routes)))
make run-form-example
make run-json-api-example