Commit 8a8ea331 authored by Christopher Lemmer Webber's avatar Christopher Lemmer Webber

Serve static files

parent b45551f1
......@@ -5,16 +5,10 @@
web-server/servlet
web-server/servlet-env
web-server/dispatch
racket/runtime-path
magenc/install-factory)
(define-values (golem-dispatch golem-url)
(dispatch-rules
[("") homepage]
[("live" (string-arg)) live-object]
[("live" (string-arg) "inbox") live-object-inbox]
[("live" (string-arg) "outbox") live-object-outbox]
[("enc" (string-arg)) serve-encrypted-object]
[else four-oh-four]))
(define-runtime-path cwd ".")
(define (ok body #:content-type [content-type #"application/octet-stream"])
(response
......@@ -47,7 +41,7 @@
(define (decrypt-encrypted-object req enc-hash-str-key)
'TODO)
(define (four-oh-four req)
#;(define (four-oh-four req)
(response
404 #"NOT FOUND"
(current-seconds) #"text/plain"
......@@ -55,13 +49,20 @@
(lambda (out-port)
(write-bytes #"Not found X_X" out-port))))
(define (start request)
(golem-dispatch request))
(define-values (golem-dispatch golem-url)
(dispatch-rules
[("") homepage]
[("live" (string-arg)) live-object]
[("live" (string-arg) "inbox") live-object-inbox]
[("live" (string-arg) "outbox") live-object-outbox]
[("enc" (string-arg)) serve-encrypted-object]))
(define (main)
(serve/servlet start
(serve/servlet golem-dispatch
#:servlet-regexp #rx""
#:launch-browser? #f)
#:launch-browser? #f
#:extra-files-paths
(list (build-path cwd "static")))
(void))
(module+ main
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment