From a7d4e23124aa03094800cddd4f02a9eeca2fc049 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Tue, 22 Nov 2016 16:44:00 +1300 Subject: [PATCH] Redirect / to /index.html --- racketmq/hub.rkt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/racketmq/hub.rkt b/racketmq/hub.rkt index 6c96c1b..ca8821f 100644 --- a/racketmq/hub.rkt +++ b/racketmq/hub.rkt @@ -8,6 +8,7 @@ (require "protocol.rkt") (require/activate syndicate/drivers/timestate) +(require/activate syndicate/drivers/web) (require/activate "config.rkt") (require/activate "hub/static-content.rkt") (require/activate "hub/topic-demand.rkt") @@ -52,4 +53,12 @@ (assert (http-listener h p))) (during (http-listener $host-name $port) - (assert (vh host-name port)))) + (assert (vh host-name port)) + (on (web-request-get (id req) (vh host-name port) ("" ())) + (web-respond/bytes! id + #:header (web-response-header + #:code 303 + #:message #"Moved" + #:headers (list (cons 'location "/index.html") + (cons 'content-type "text/html"))) + #"Moved"))))