From fd6668c9cb932efa125de4f5ce8b05ff70f6a7ea Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 30 Jun 2022 23:17:38 +0530 Subject: web: server: Support virtual hosts. * bin/tissue (tissue-run-web): Add hosts configuration option. * tissue/web/server.scm: Import (tissue utils). (start-web-server): Add host parameters argument. (handler): Read database based on Host header. --- bin/tissue | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin') diff --git a/bin/tissue b/bin/tissue index bf69100..4b524b8 100755 --- a/bin/tissue +++ b/bin/tissue @@ -251,6 +251,10 @@ Run a web search service reading configuration from CONFIG-FILE. listen-repl) (make-unix-domain-server-socket #:path listen-repl)))))) (start-web-server (listen->socket-address (assq-ref args 'listen)) + (or (assq-ref args 'hosts) + ;; Assume current directory as default. + `(("localhost" + (indexed-repository . ,(getcwd))))) %xapian-index (tissue-configuration-web-css (load-config))))))) -- cgit v1.2.3