repair `in` and `out` routes to work in subdirs

pull/127/head
Matthew Butterick 8 years ago
parent 9e66e3547f
commit 2740967e53

@ -56,7 +56,9 @@
(define/contract (route-wrapper route-proc)
(procedure? . -> . procedure?)
(λ(req . string-args)
(logger req)
(logger req)
;; `flatten` here because servlet's route matcher might send a list of lists
;; for "before and after" matches, like `((string-arg) ... "in" (string-arg) ...)`
(define path (apply build-path (current-project-root) (flatten string-args)))
(response/xexpr+doctype (route-proc path))))

@ -17,8 +17,8 @@
(dispatch-rules
[((string-arg) ... (? (λ(x) (equal? "" x)))) route-index] ; last element of a "/"-terminated url is ""
[((string-arg) ... (? pagetree-source?)) route-dashboard]
[("in" (string-arg) ...) route-in]
[("out" (string-arg) ...) route-out]
[((string-arg) ... "in" (string-arg) ...) route-in]
[((string-arg) ... "out" (string-arg) ...) route-out]
[else route-default]))
(message (format "Welcome to Pollen ~a" pollen:version) (format "(Racket ~a)" (version)))

@ -1 +1 @@
1471443458
1471898388

Loading…
Cancel
Save