2022-08-23 09:57:42 +00:00
|
|
|
#lang racket/base
|
2022-08-30 12:45:37 +00:00
|
|
|
(require web-server/servlet-dispatch
|
2022-08-23 10:43:44 +00:00
|
|
|
"src/config.rkt"
|
2022-09-04 10:13:36 +00:00
|
|
|
"src/dispatcher-tree.rkt"
|
2022-08-30 12:45:37 +00:00
|
|
|
"src/reloadable.rkt")
|
2022-08-23 09:57:42 +00:00
|
|
|
|
2022-08-30 09:33:28 +00:00
|
|
|
(define-syntax-rule (require-reloadable filename varname)
|
|
|
|
(define varname
|
|
|
|
(reloadable-entry-point->procedure
|
|
|
|
(make-reloadable-entry-point (quote varname) filename))))
|
|
|
|
|
|
|
|
(require-reloadable "src/page-category.rkt" page-category)
|
2022-09-17 10:36:04 +00:00
|
|
|
(require-reloadable "src/page-global-search.rkt" page-global-search)
|
2022-08-30 09:33:28 +00:00
|
|
|
(require-reloadable "src/page-home.rkt" page-home)
|
2022-10-13 09:40:14 +00:00
|
|
|
(require-reloadable "src/page-it-works.rkt" page-it-works)
|
2022-08-30 09:33:28 +00:00
|
|
|
(require-reloadable "src/page-not-found.rkt" page-not-found)
|
|
|
|
(require-reloadable "src/page-proxy.rkt" page-proxy)
|
2022-09-09 03:42:20 +00:00
|
|
|
(require-reloadable "src/page-redirect-wiki-home.rkt" redirect-wiki-home)
|
2022-08-30 09:33:28 +00:00
|
|
|
(require-reloadable "src/page-search.rkt" page-search)
|
2022-11-29 11:03:54 +00:00
|
|
|
(require-reloadable "src/page-set-user-settings.rkt" page-set-user-settings)
|
2022-08-30 12:45:37 +00:00
|
|
|
(require-reloadable "src/page-static.rkt" static-dispatcher)
|
2023-02-05 04:56:15 +00:00
|
|
|
(require-reloadable "src/page-static-archive.rkt" page-static-archive)
|
2022-09-04 13:32:45 +00:00
|
|
|
(require-reloadable "src/page-subdomain.rkt" subdomain-dispatcher)
|
2022-08-30 09:33:28 +00:00
|
|
|
(require-reloadable "src/page-wiki.rkt" page-wiki)
|
2023-02-05 04:56:15 +00:00
|
|
|
(require-reloadable "src/page-wiki-offline.rkt" page-wiki-offline)
|
2022-10-08 08:35:35 +00:00
|
|
|
(require-reloadable "src/page-file.rkt" page-file)
|
2022-08-24 01:23:46 +00:00
|
|
|
|
2022-08-30 09:33:28 +00:00
|
|
|
(reload!)
|
|
|
|
|
2022-09-01 02:55:25 +00:00
|
|
|
(define ch (make-channel))
|
|
|
|
(define (start)
|
|
|
|
(serve/launch/wait
|
2023-03-08 09:53:07 +00:00
|
|
|
#:listen-ip (if (equal? (config-get 'bind_host) "auto")
|
|
|
|
(if (config-true? 'debug) "127.0.0.1" #f)
|
|
|
|
(config-get 'bind_host))
|
2022-09-01 02:55:25 +00:00
|
|
|
#:port (string->number (config-get 'port))
|
|
|
|
(λ (quit)
|
|
|
|
(channel-put ch (lambda () (semaphore-post quit)))
|
2022-09-04 10:13:36 +00:00
|
|
|
(dispatcher-tree
|
|
|
|
; order of these does not matter
|
|
|
|
page-category
|
2022-09-17 10:36:04 +00:00
|
|
|
page-global-search
|
2022-09-04 10:13:36 +00:00
|
|
|
page-home
|
2022-10-13 09:40:14 +00:00
|
|
|
page-it-works
|
2022-09-04 10:13:36 +00:00
|
|
|
page-not-found
|
|
|
|
page-proxy
|
|
|
|
page-search
|
2022-11-29 11:03:54 +00:00
|
|
|
page-set-user-settings
|
2023-02-05 04:56:15 +00:00
|
|
|
page-static-archive
|
2022-09-04 10:13:36 +00:00
|
|
|
page-wiki
|
2023-02-05 04:56:15 +00:00
|
|
|
page-wiki-offline
|
2022-10-08 08:35:35 +00:00
|
|
|
page-file
|
2022-09-09 03:42:20 +00:00
|
|
|
redirect-wiki-home
|
2022-09-04 13:32:45 +00:00
|
|
|
static-dispatcher
|
|
|
|
subdomain-dispatcher))))
|
2022-09-01 02:55:25 +00:00
|
|
|
(define server-t (thread start))
|
|
|
|
(define quit (channel-get ch))
|