macchiato.server
http-server
(http-server {:keys [handler host port on-success websockets?], :as opts})
:host - hostname to bind
:port - HTTP port the server will listen on
:handler - Macchiato handler function for handling request/response
:on-success - success callback that's called when server starts listening
https-server
(https-server {:keys [handler host port on-success private-key certificate], :as opts})
:host - hostname to bind
:port - HTTP port the server will listen on
:handler - Macchiato handler function for handling request/response
:on-success - success callback that's called when server starts listening
:private-key - path to the private key
:certificate - path to the certificate for the key
start
(start {:keys [handler host port protocol], :or {host "0.0.0.0", protocol :http}, :as opts})
:host - hostname to bind (default 0.0.0.0)
:port - HTTP port the server will listen on
:protocol - :http or :https (default :http)
:handler - Macchiato handler function for handling request/response
:on-success - success callback that's called when server starts listening
:private-key - path to the private key (only used when protocol is :https)
:websockets? - boolean for enabling websockets
:certificate - path to the certificate for the key (only used when protocol is :https)
start-ws
(start-ws server handler)
starts a WebSocket server given a handler and a Node server instance