diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-19 02:16:45 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-19 02:16:45 +0100 |
commit | 13e285955508e601d6a648c25e29632340b4d9b6 (patch) | |
tree | 10b60331b967c1e2e267f07b997d259ef3441879 /src | |
parent | f7d823cd3455aa73a17c927382ea3f34f4610c23 (diff) |
feat(backend): serve index page from assets directory
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/tubo/handler.clj | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/backend/tubo/handler.clj b/src/backend/tubo/handler.clj index bff4326..8a438b8 100644 --- a/src/backend/tubo/handler.clj +++ b/src/backend/tubo/handler.clj @@ -1,27 +1,13 @@ (ns tubo.handler (:require [clojure.string :as str] - [hiccup.page :as hiccup] - [ring.util.response :refer [response]] + [ring.util.response :refer [response resource-response content-type]] [tubo.api :as api])) (defn index [_] - (response - (hiccup/html5 - [:head - [:meta {:charset "UTF-8"}] - [:meta - {:name "viewport" - :content - "width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"}] - [:title "Tubo"] - [:link {:rel "icon" :type "image/svg+xml" :href "/icons/tubo.svg"}] - (hiccup/include-css "/styles/index.css")] - [:body - [:div#app] - (hiccup/include-js "/js/main.js") - [:script "tubo.core.init();"]]))) + (-> (resource-response "index.html" {:root "public"}) + (content-type "text/html"))) (defn search [{{{:keys [service-id]} :path {:keys [q]} :query} :parameters |