Extract the database connection handling from the server

Previously, one of the first things that happened when responding to a request
was a database connection was made, even when serving the CSS. This is
unnecessary, so move the database connection handling in to the controller.

Also, to allow for separating it out from the assets, separate the assets out
from the parts of the controller that require a database connection.
This commit is contained in:
Christopher Baines 2019-06-06 20:39:06 +01:00
parent 544dc1558f
commit aad2c9d9e8
4 changed files with 39 additions and 31 deletions

View file

@ -74,18 +74,18 @@
(@ (rel "stylesheet")
(media "screen")
(type "text/css")
(href "/css/reset.css")))
(href "/assets/css/reset.css")))
(link
(@ (rel "stylesheet")
(media "screen")
(type "text/css")
(href "/css/bootstrap.css")))
(href "/assets/css/bootstrap.css")))
,@head
(link
(@ (rel "stylesheet")
(media "screen")
(type "text/css")
(href "/css/screen.css"))))
(href "/assets/css/screen.css"))))
(body ,@body
(footer
(p "Copyright © 2016—2019 by the GNU Guix community."