mirror of
https://gitdab.com/cadence/breezewiki.git
synced 2026-04-18 21:54:34 -04:00
In breezewiki.rkt, start server in thread
This allows inspecting the program state using (enter! "breezewiki.rkt") in the REPL.
This commit is contained in:
+17
-12
@@ -24,15 +24,20 @@
|
||||
(set-reload-poll-interval! #f))
|
||||
(reload!)
|
||||
|
||||
(serve/launch/wait
|
||||
#:listen-ip (if (config-true? 'debug) "127.0.0.1" #f)
|
||||
#:port (string->number (config-get 'port))
|
||||
(λ (quit)
|
||||
(sequencer:make
|
||||
(pathprocedure:make "/" page-home)
|
||||
(pathprocedure:make "/proxy" page-proxy)
|
||||
(filter:make #rx"^/[a-z-]+/wiki/Category:.+$" (lift:make page-category))
|
||||
(filter:make #rx"^/[a-z-]+/wiki/.+$" (lift:make page-wiki))
|
||||
(filter:make #rx"^/[a-z-]+/search$" (lift:make page-search))
|
||||
static-dispatcher
|
||||
(lift:make page-not-found))))
|
||||
(define ch (make-channel))
|
||||
(define (start)
|
||||
(serve/launch/wait
|
||||
#:listen-ip (if (config-true? 'debug) "127.0.0.1" #f)
|
||||
#:port (string->number (config-get 'port))
|
||||
(λ (quit)
|
||||
(channel-put ch (lambda () (semaphore-post quit)))
|
||||
(sequencer:make
|
||||
(pathprocedure:make "/" page-home)
|
||||
(pathprocedure:make "/proxy" page-proxy)
|
||||
(filter:make #rx"^/[a-z-]+/wiki/Category:.+$" (lift:make page-category))
|
||||
(filter:make #rx"^/[a-z-]+/wiki/.+$" (lift:make page-wiki))
|
||||
(filter:make #rx"^/[a-z-]+/search$" (lift:make page-search))
|
||||
static-dispatcher
|
||||
(lift:make page-not-found)))))
|
||||
(define server-t (thread start))
|
||||
(define quit (channel-get ch))
|
||||
|
||||
Reference in New Issue
Block a user