Liking cljdoc? Tell your friends :D

yuhrao.webserver.core


appclj

(app config)

Create a ring handler from a config map. Config map:

  • :router - A reitit router. Reitit Docs
  • :disable-logs? - A boolean to disable logs. Default is false
  • :openapi - A map with openapi options. Reitit OpenAPI Docs
  • :swagger - A map with swagger options. Reitit Swagger Docs
  • :middlewares - A vector of middlewares.

Observations:

  • When neither :openapi nor :swagger are provided, the server will not serve any openapi or swagger documentation.
  • Middlewares are applied using sieppari.
Create a ring handler from a config map.
Config map:
- `:router` - A reitit router. [Reitit Docs](https://cljdoc.org/d/metosin/reitit/0.6.0/doc/basics/router)
- `:disable-logs?` - A boolean to disable logs. Default is `false`
- `:openapi` - A map with openapi options. [Reitit OpenAPI Docs](https://cljdoc.org/d/metosin/reitit/0.7.0-alpha7/doc/ring/openapi-support?q=openapi#openapi-support)
- `:swagger` - A map with swagger options. [Reitit Swagger Docs](https://cljdoc.org/d/metosin/reitit/0.7.0-alpha7/doc/ring/swagger-support)
- `:middlewares` - A vector of middlewares.

Observations:
- When neither `:openapi` nor `:swagger` are provided, the server will not serve any openapi or swagger documentation.
- Middlewares are applied using sieppari.
raw docstring

serversclj


start!clj

(start! {:keys [server-id] :as config})

Start a server from a config map. Config map:

  • :server-id - A unique identifier for the server. Used to stop the server.
  • :join? - A boolean to join the server thread. Default is false
  • :port - A port number. No default is provided
  • :host - A host name. Defaults to 0.0.0.0
  • Accpts any parameter that app function accepts.

Notes:

  • Ring handler is created internally using app function.
  • Shutdown hook is automatically added to stop the server when the JVM is stopped.
Start a server from a config map.
Config map:
- `:server-id` - A unique identifier for the server. Used to stop the server.
- `:join?` - A boolean to join the server thread. Default is `false`
- `:port` - A port number. No default is provided
- `:host` - A host name. Defaults to `0.0.0.0`
- Accpts any parameter that `app` function accepts.

Notes:
- Ring handler is created internally using `app` function.
- Shutdown hook is automatically added to stop the server when the JVM is stopped.
raw docstring

stop!clj

(stop! server-id)

Stop a server by its id.

Stop a server by its id.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close