diff --git a/breezewiki.rkt b/breezewiki.rkt index e1cbf2f..e6f537f 100644 --- a/breezewiki.rkt +++ b/breezewiki.rkt @@ -1,5 +1,6 @@ #lang racket/base (require racket/path + racket/runtime-path net/url web-server/servlet-dispatch web-server/dispatchers/filesystem-map @@ -15,6 +16,8 @@ "src/page-wiki.rkt" "src/page-search.rkt") +(define-runtime-path path-static "static") + (define mime-types (hash #".css" #"text/css" #".svg" #"image/svg+xml")) @@ -30,7 +33,7 @@ (filter:make #rx"^/static/" (files:make #:url->path (lambda (u) - ((make-url->path "static") + ((make-url->path path-static) (struct-copy url u [path (cdr (url-path u))]))) #:path->mime-type (lambda (u) diff --git a/src/config.rkt b/src/config.rkt index 136c08a..7618cd7 100644 --- a/src/config.rkt +++ b/src/config.rkt @@ -1,8 +1,11 @@ #lang racket/base +(require racket/runtime-path) (provide config-get) +(define-runtime-path path-config "../config.txt") + (define (config-get key) (hash-ref config key)) @@ -18,7 +21,7 @@ default-config (with-handlers ([exn:fail:filesystem:errno? (λ (exn) '())]) - (call-with-input-file "../config.txt" + (call-with-input-file path-config (λ (in) (let loop ([alist '()]) (let ([key (read in)]