More progress towards working websockets stuff. Add mime-types.scm to contrib.
[mudsync.git] / mudsync / networking.scm
index b938c8a9427bdf53936c44c1e9b7a045abdd4048..1c28b38dcbb4ef872c8e1663e5fa12dac2eb6329 100644 (file)
@@ -32,6 +32,7 @@
   #:use-module (web response)
   #:use-module (web uri)
   #:use-module (mudsync package-config)
+  #:use-module (mudsync contrib mime-types)
   #:use-module (rnrs io ports)
 
   #:export (;; Should we be exporting these?
            (head (title "Mudsync!")
                  (meta (@ (charset "UTF-8")))
                  (link (@ (rel "stylesheet")
-                          (href "/static/css/main.css"))))
+                          (href "/static/css/main.css")))
+                 (script (@ (type "text/javascript")
+                            (src "/static/js/mudsync.js"))))
            (body ,@body-tmpl)))
   (define (write-template-to-string)
     (with-fluids ((%default-port-encoding "UTF-8"))
 
 (define (view:render-static request body static-path)
   (values (build-response #:code 200
-                          ;; #:content-type (mime-type static-path)
-                          )
+                          #:headers `((content-type . (,(mime-type static-path)))))
           (call-with-input-file (web-static-filepath static-path) get-bytevector-all)))
 
 (define (view:standard-four-oh-four . args)