From 6e919c73b19e20c837b9f54319ca4c1868392a1f Mon Sep 17 00:00:00 2001 From: David Thompson Date: Mon, 13 Oct 2014 21:34:44 -0400 Subject: Allow hostname customization. * guix-web/config.scm (guix-web-host): New variable. * guix-web/render.scm (render-static-asset, redirect): Use 'guix-web-host'. --- guix-web/config.scm | 2 ++ guix-web/render.scm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/guix-web/config.scm b/guix-web/config.scm index 5de3dea..8094d83 100644 --- a/guix-web/config.scm +++ b/guix-web/config.scm @@ -18,7 +18,9 @@ (define-module (guix-web config) #:use-module (ice-9 match) #:export (guix-web-asset-dir + guix-web-host guix-web-port)) (define guix-web-asset-dir (getcwd)) +(define guix-web-host "localhost") (define guix-web-port 8080) diff --git a/guix-web/render.scm b/guix-web/render.scm index 1d88831..375c81d 100644 --- a/guix-web/render.scm +++ b/guix-web/render.scm @@ -44,7 +44,7 @@ (file-extension file-name)))) (call-with-input-file file-name get-bytevector-all)) (not-found (build-uri 'http - #:host "localhost" + #:host guix-web-host #:port guix-web-port #:path (string-join path "/" 'prefix)))))) @@ -73,7 +73,7 @@ (define (redirect path) (let ((uri (build-uri 'http - #:host "localhost" + #:host guix-web-host #:port guix-web-port #:path (string-append "/" (encode-and-join-uri-path path))))) -- cgit v1.2.3