Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Meddle is a middleware stack for use with HttpServer.jl.
Julia
branch: master
Failed to load latest commit information.
src removed comma #9
.travis.yml Create .travis.yml
LICENSE.txt added MIT license
README.md Update README.md
REQUIRE Update REQUIRE

README.md

Meddle

Meddle is a middleware stack for use with HttpServer.jl.

Installation: Pkg.add("Meddle")

Example:

Define a 'stack' of middleware through which incoming Requests are processed:

using HttpServer
using Meddle

stack = middleware(DefaultHeaders, URLDecoder, CookieDecoder, FileServer(pwd()), NotFound)
http = HttpHandler((req, res)->Meddle.handle(stack, MeddleRequest(req, Dict{Symbol,Any}()), res))

for event in split("connect read write close error")
    http.events[event] = (event->(client, args...)->println(client.id,": $event"))(event)
end
http.events["error"] = (client, err)->println(err)
http.events["listen"] = (port)->println("Listening on $port...")

server = Server(http)
run(server, 8000)
:::::::::::::
::         ::
:: Made at ::
::         ::
:::::::::::::
     ::
Hacker School
:::::::::::::
Something went wrong with that request. Please try again.