summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tissue/web/dev.scm10
-rw-r--r--tissue/web/server.scm12
2 files changed, 13 insertions, 9 deletions
diff --git a/tissue/web/dev.scm b/tissue/web/dev.scm
index 2be978c..0140e0f 100644
--- a/tissue/web/dev.scm
+++ b/tissue/web/dev.scm
@@ -1,5 +1,5 @@
;;; tissue --- Text based issue tracker
-;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2022, 2023 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of tissue.
;;;
@@ -40,9 +40,6 @@ documentation of @var{xapian-index} and @var{project-thunk}."
(path (uri-path (request-uri request))))
(log-request request)
(cond
- ;; Search page
- ((member path (list "/" "/search"))
- (search-handler request body xapian-index project))
;; Files
((any (lambda (web-file)
(cond
@@ -60,6 +57,11 @@ documentation of @var{xapian-index} and @var{project-thunk}."
(lambda (port get-bytevector)
((file-writer file) port)
(get-bytevector))))))
+ ;; Search page. We look for the search page only after files
+ ;; because we want to let files shadow the search page if
+ ;; necessary.
+ ((member path (list "/" "/search"))
+ (search-handler request body xapian-index project))
;; Not found
(else
(404-response request)))))
diff --git a/tissue/web/server.scm b/tissue/web/server.scm
index 95bed70..2e59a77 100644
--- a/tissue/web/server.scm
+++ b/tissue/web/server.scm
@@ -157,11 +157,6 @@ See `start-web-server' for documentation of HOSTS."
(repository-open
(assq-ref host-parameters 'repository-directory))))
(cond
- ;; Search page
- ((member path (list "/" "/search"))
- (search-handler request body
- (assq-ref host-parameters 'xapian-directory)
- (assq-ref host-parameters 'project)))
;; Static files
((let ((file-path
(find file-exists?
@@ -178,6 +173,13 @@ See `start-web-server' for documentation of HOSTS."
(file-name-extension file-path))))
(call-with-input-file file-path
get-bytevector-all))))
+ ;; Search page. We look for the search page only after files
+ ;; because we want to let files shadow the search page if
+ ;; necessary.
+ ((member path (list "/" "/search"))
+ (search-handler request body
+ (assq-ref host-parameters 'xapian-directory)
+ (assq-ref host-parameters 'project)))
;; Not found
(else
(404-response request))))))