From 7961b13c1505670313b4f53c47b465eb25e592a5 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Wed, 6 May 2026 20:15:26 +0200 Subject: [PATCH] feat: add apple touch icons and root routes --- internal/server/routes.go | 18 +++++++++++++++ .../apple-touch-icon-120x120-precomposed.svg | 23 +++++++++++++++++++ static/apple-touch-icon-120x120.svg | 23 +++++++++++++++++++ static/apple-touch-icon-precomposed.svg | 23 +++++++++++++++++++ static/apple-touch-icon.svg | 23 +++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 static/apple-touch-icon-120x120-precomposed.svg create mode 100644 static/apple-touch-icon-120x120.svg create mode 100644 static/apple-touch-icon-precomposed.svg create mode 100644 static/apple-touch-icon.svg diff --git a/internal/server/routes.go b/internal/server/routes.go index 3ccf8aa..863a167 100644 --- a/internal/server/routes.go +++ b/internal/server/routes.go @@ -67,6 +67,24 @@ func NewRouter(cfg Config) http.Handler { dist := http.FileServer(http.Dir("./dist")) mux.Handle("/dist/", http.StripPrefix("/dist/", withMimeTypes(dist))) + // Serve Apple Touch Icons from static directory + mux.HandleFunc("/apple-touch-icon.png", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "image/svg+xml") + http.ServeFile(w, r, "./static/apple-touch-icon.svg") + }) + mux.HandleFunc("/apple-touch-icon-precomposed.png", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "image/svg+xml") + http.ServeFile(w, r, "./static/apple-touch-icon-precomposed.svg") + }) + mux.HandleFunc("/apple-touch-icon-120x120.png", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "image/svg+xml") + http.ServeFile(w, r, "./static/apple-touch-icon-120x120.svg") + }) + mux.HandleFunc("/apple-touch-icon-120x120-precomposed.png", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "image/svg+xml") + http.ServeFile(w, r, "./static/apple-touch-icon-120x120-precomposed.svg") + }) + mux.HandleFunc("/", animeHandler.HandleCatalog) mux.HandleFunc("/api/catalog/airing", animeHandler.HandleCatalogAiring) mux.HandleFunc("/api/catalog/popular", animeHandler.HandleCatalogPopular) diff --git a/static/apple-touch-icon-120x120-precomposed.svg b/static/apple-touch-icon-120x120-precomposed.svg new file mode 100644 index 0000000..fb4251d --- /dev/null +++ b/static/apple-touch-icon-120x120-precomposed.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/apple-touch-icon-120x120.svg b/static/apple-touch-icon-120x120.svg new file mode 100644 index 0000000..fb4251d --- /dev/null +++ b/static/apple-touch-icon-120x120.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/apple-touch-icon-precomposed.svg b/static/apple-touch-icon-precomposed.svg new file mode 100644 index 0000000..fb4251d --- /dev/null +++ b/static/apple-touch-icon-precomposed.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/apple-touch-icon.svg b/static/apple-touch-icon.svg new file mode 100644 index 0000000..fb4251d --- /dev/null +++ b/static/apple-touch-icon.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file