On this page:

23 Server

 (require koyo/server) package: koyo-lib

This module provides a web server component.


(server? v)  boolean?

  v : any/c
Returns #t when v is a server.


((make-server-factory [#:unix-socket socket-path    
  #:host host    
  #:port port    
  #:limits limits])    
  dispatcher)  server?
  socket-path : (or/c #f path-string?) = #f
  host : non-empty-string? = ""
  port : (integer-in 0 65535) = 8000
  limits : safety-limits? = (make-safety-limits)
  dispatcher : dispatcher/c
Creates a component that, when started, runs a web server bound to #:host and #:port using the given dispatcher. When the #:unix-socket argument is provided, the server is bound to a socket at that path instead and the #:host and #:port arguments are ignored. When the server component is stopped, the unix socket (if provided) is deleted.

The #:limits are passed directly to serve.