aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service/web/controller.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-10-06 14:23:15 +0100
committerChristopher Baines <mail@cbaines.net>2019-10-06 14:23:15 +0100
commitdbe171bc750eee4d6b85e220e03466fc4d7b851f (patch)
tree0e3a12a93123cdea79ad0da3314510081f6357ff /guix-data-service/web/controller.scm
parenteab5a70976def28993244235420c70dbd8296e6c (diff)
downloaddata-service-dbe171bc750eee4d6b85e220e03466fc4d7b851f.tar
data-service-dbe171bc750eee4d6b85e220e03466fc4d7b851f.tar.gz
Handle potentially serving assets from the store
Diffstat (limited to 'guix-data-service/web/controller.scm')
-rw-r--r--guix-data-service/web/controller.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm
index 13b315d..e028e2a 100644
--- a/guix-data-service/web/controller.scm
+++ b/guix-data-service/web/controller.scm
@@ -731,11 +731,16 @@
(define (parse-build-status s)
s)
+(define handle-static-assets
+ (if assets-dir-in-store?
+ (static-asset-from-store-renderer)
+ render-static-asset))
+
(define (controller request method-and-path-components mime-types body)
(match method-and-path-components
(('GET "assets" rest ...)
- (or (render-static-asset (string-join rest "/")
- (request-headers request))
+ (or (handle-static-assets (string-join rest "/")
+ (request-headers request))
(not-found (request-uri request))))
(('GET "healthcheck")
(let ((database-status