immutant.web documentation

Associate one or more Ring handlers with your application, mounted
at unique context paths


Returns the currently active HttpServletRequest. This will only
return a value within an active ring handler. Standard ring handlers
should never need to access this value.



(start handler)(start handler options)(start path handler options)
Registers a Ring handler that will be called when requests
are received on the given sub-context-path. If no sub-context-path
is given, "/" is assumed.

The options are a subset of those for ring-server [default]:
  :init          function called after handler is initialized [nil]
  :destroy       function called after handler is stopped [nil]
  :stacktraces?  display stacktraces when exception is thrown [true in :dev]
  :auto-reload?  automatically reload source files [true in :dev]
  :reload-paths  seq of src-paths to reload on change [dirs on classpath]


(start-handler sub-context-path handler & {:keys [init destroy], :as opts})
Typically not called directly; use start instead


(start-servlet sub-context-path servlet)
Can be used to mount a servlet in lieu of a typical Ring handler


(stop)(stop sub-context-path)
Deregisters the Ring handler or servlet mounted at the given sub-context-path.
If no sub-context-path is given, "/" is assumed.


(wrap-resource handler root-path)
Temporary workaround for its non-context-aware namesake from
ring.middleware.resource. This function will go away when Ring 1.2
is released.

Middleware that first checks to see whether the request map matches
a static resource. If it does, the resource is returned in a
response map, otherwise the request map is passed onto the handler.
The root-path argument will be added to the beginning of the
resource path.