diff options
-rw-r--r-- | mumi/web/server.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mumi/web/server.scm b/mumi/web/server.scm index db7662a..6de6fa4 100644 --- a/mumi/web/server.scm +++ b/mumi/web/server.scm @@ -18,6 +18,7 @@ (define-module (mumi web server) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) #:use-module (web http) #:use-module (web request) #:use-module (web uri) @@ -39,6 +40,11 @@ (format (current-error-port) "Mumi web server listening on http://~a:~a/~%" address port) - (run-server handler + ;; Wrap handler in another function to support live hacking via the + ;; REPL. If handler is passed as is and is then redefined via the + ;; REPL, the web server will still be using the old handler. The + ;; only way to update the handler reference held by the web server + ;; would be to restart the web server. + (run-server (cut handler <> <>) #:addr (inet-pton AF_INET address) #:port port)) |