summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--haunt/ui/serve.scm11
1 files changed, 7 insertions, 4 deletions
diff --git a/haunt/ui/serve.scm b/haunt/ui/serve.scm
index 6e58a31..09bcfcc 100644
--- a/haunt/ui/serve.scm
+++ b/haunt/ui/serve.scm
@@ -27,6 +27,7 @@
#:use-module (srfi srfi-37)
#:use-module (ice-9 match)
#:use-module (ice-9 format)
+ #:use-module (haunt site)
#:use-module (haunt config)
#:use-module (haunt ui)
#:use-module (haunt serve web-server)
@@ -60,11 +61,13 @@ Start an HTTP server for the current site.~%")
%common-options))
(define %default-options
- (cons '((port . 8080))
+ (cons '(port . 8080)
%default-common-options))
(define (haunt-serve . args)
(let* ((opts (simple-args-fold args %options %default-options))
- (port (assoc-ref opts 'port)))
- (format #t "serving ~a on port ~d~%" (haunt-output-directory) port)
- (serve (haunt-output-directory))))
+ (port (assq-ref opts 'port))
+ (site (load-config (assq-ref opts 'config)))
+ (doc-root (site-build-directory site)))
+ (format #t "serving ~a on port ~d~%" doc-root port)
+ (serve doc-root)))