From 13e285955508e601d6a648c25e29632340b4d9b6 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Thu, 19 Dec 2024 02:16:45 +0100 Subject: feat(backend): serve index page from assets directory --- resources/src/index.html | 26 +++++++++++++------------- src/backend/tubo/handler.clj | 20 +++----------------- 2 files changed, 16 insertions(+), 30 deletions(-) diff --git a/resources/src/index.html b/resources/src/index.html index 71d7815..f4e6632 100644 --- a/resources/src/index.html +++ b/resources/src/index.html @@ -1,15 +1,15 @@ - + - - - - - - Tubo - - - -
- - + + + + + + Tubo + + + +
+ + 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 -- cgit v1.2.3