(->Config opt)Build a Config object out from a Clojure map.
Build a Config object out from a Clojure map.
(close server)Close the server (the same as stop).
Close the server (the same as stop).
(server handler)(server handler opt)Given a Clojure Ring handler (arity-1 function)
and, optionally a Clojure map of options, run
an HTTP server in a separate thread. Return an
instance of the ring.adapter.jdk.Server class.
Needs to be closed afterwards; can be used with
the with-open macro.
Optional parameters:
:host is the host name to bind (default is 127.0.0.1).:port is the port number to listen (default is 8080).:threads is the number of threads to use. When > 0,
then a custom instance of FixedThreadPool is used.:executor is a custom Executor object, if needed.:root-path is a string, a global path prefix for
the handier.:stop-delay-sec is a number of seconds to wait when
closing the server;:socket-backlog is a number, an option for socket
when binding a server.Given a Clojure Ring handler (arity-1 function) and, optionally a Clojure map of options, run an HTTP server in a separate thread. Return an instance of the `ring.adapter.jdk.Server` class. Needs to be closed afterwards; can be used with the `with-open` macro. Optional parameters: - `:host` is the host name to bind (default is 127.0.0.1). - `:port` is the port number to listen (default is 8080). - `:threads` is the number of threads to use. When > 0, then a custom instance of FixedThreadPool is used. - `:executor` is a custom Executor object, if needed. - `:root-path` is a string, a global path prefix for the handier. - `:stop-delay-sec` is a number of seconds to wait when closing the server; - `:socket-backlog` is a number, an option for socket when binding a server.
(stop server)Close the server (the same as close).
Close the server (the same as close).
(with-server [handler opt] & body)A wrapper on top of the with-open macro. Takes a handler
(mandatory) and an optional map of parameters. Runs the server
while the body is being executed. Closes the server instance
on exit.
A wrapper on top of the `with-open` macro. Takes a handler (mandatory) and an optional map of parameters. Runs the server while the body is being executed. Closes the server instance on exit.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |