summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorArun Isaac2025-03-26 01:03:02 +0000
committerArun Isaac2025-03-26 02:10:49 +0000
commita9187595cccca4954c7d4920b93b922ea190e179 (patch)
treeee83194c7ed2a80e3c50196ec7a4689393ac92d6 /bin
parentecccf70f709523f3ecaa1b6fdccad4e5250a7ae5 (diff)
downloadtissue-main.tar.gz
tissue-main.tar.lz
tissue-main.zip
bin: Introduce --base-path argument for web-dev subcommand. HEAD main
* bin/tissue (tissue-web-dev): Introduce --base-path argument.
* tissue/web/dev.scm (handler, start-dev-web-server): Add base-path
argument.
* tissue/web/server.scm (rebase-uri-path): Export.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/tissue10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/tissue b/bin/tissue
index 2b5ab7d..1e45d89 100755
--- a/bin/tissue
+++ b/bin/tissue
@@ -323,6 +323,7 @@ Serve website and issues of current repository.
 
   --port=PORT       run web server listening on PORT (default: 8080)
   --listen-repl=P   run REPL server listening on port or path P
+  --base-path=PATH  serve website at PATH
 "
              (command-line-program)))
     (args
@@ -333,13 +334,20 @@ Serve website and issues of current repository.
                                           (lambda (opt name arg result)
                                             (acons 'port
                                                    (string->number arg)
+                                                   result)))
+                                  (option '(#\b "base-path")
+                                          #t #f
+                                          (lambda (opt name arg result)
+                                            (acons 'base-path arg
                                                    result))))
                             invalid-option
                             unrecognized-argument
-                            '((port . 8080)))))
+                            '((port . 8080)
+                              (base-path . "/")))))
        (when (assq-ref args 'listen-repl)
          (start-repl (assq-ref args 'listen-repl)))
        (start-dev-web-server (assq-ref args 'port)
+                             (assq-ref args 'base-path)
                              %xapian-index load-config)))))
 
 (define (print-usage)