Build Status |
---|
Simple and fast HTTP parser for CRUD API backend Julia web frameworks.
Takes advantage of Julia multi-threading via ThreadPools and parses requests as buffer via BufferedStreams.
Architecture inspired from PicoHTTPParser.
Simply wrap your routing function inside start_server
:
Flamenco.start_server("127.0.0.1", 8000) do request::Flamenco.Server.Request
routes(; request_headers=request.headers, request_method=request.method, request_path=request.target, request_payload=request.body)
end
Your routing function must accept the 4 arguments:
- request.headers ::Dict{String, String}
- request.method ::String
- request.target ::String
- request.body ::String
Content-Type
Header must be set inside your routing function as well. If Content-Length
and Date
Headers are not set, Flamenco will automatically set these in the HTTP response.
If you would prefer this routing logic to be automatically taken care of, see DanceJL as an example..
Currently only HTTP 1.1 is supported.
Also the incoming request must be one of: DELETE, GET, OPTIONS, POST or PUT.