From 2860406a07fd1ed390aaea9e0316e11141697ee2 Mon Sep 17 00:00:00 2001
From: Janne Koschinski <janne@kuschku.de>
Date: Sat, 17 Mar 2018 22:41:46 +0100
Subject: [PATCH] Improved paths

---
 main.go                  | 2 +-
 templates/me_images.html | 4 ++--
 templates/upload.html    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/main.go b/main.go
index 76b21a8..4f00e2c 100644
--- a/main.go
+++ b/main.go
@@ -314,7 +314,6 @@ func main() {
 	})
 
 	http.Handle("/assets/", http.StripPrefix("/assets/", assetServer))
-	http.Handle("/i/", http.StripPrefix("/i/", imageServer))
 	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
 		user := parseUser(r)
 
@@ -328,6 +327,7 @@ func main() {
 			panic(err)
 		}
 	})
+	http.Handle("/", imageServer)
 
 	err = http.ListenAndServe(":8080", nil)
 	if err != nil {
diff --git a/templates/me_images.html b/templates/me_images.html
index 3a4dff4..fdeda88 100644
--- a/templates/me_images.html
+++ b/templates/me_images.html
@@ -2,9 +2,9 @@
 {{define "content"}}
 <div class="images">
 {{range .Images}}
-    <a class="image" href="/i/{{.Id}}">
+    <a class="image" href="/{{.Id}}">
         <div class="image-container">
-            <img src="/i/{{.Id}}t" >
+            <img src="/{{.Id}}t" >
         </div>
         <div class="info">
             <p>{{.OriginalName}}</p>
diff --git a/templates/upload.html b/templates/upload.html
index 7f08def..99b5f81 100644
--- a/templates/upload.html
+++ b/templates/upload.html
@@ -3,7 +3,7 @@
 {{range .Results}}
 {{if .Success}}
 <div class="info success">
-    <h2>Upload of {{.Id}} finished. <a href="/i/{{.Id}}">View</a>.</h2>
+    <h2>Upload of {{.Id}} finished. <a href="/{{.Id}}">View</a>.</h2>
 </div>
 {{else}}
 <div class="info error">
-- 
GitLab