From f8b5ce3e9c5b6624c8ef309ae5369f3ec9e87480 Mon Sep 17 00:00:00 2001 From: James Mills Date: Sun, 9 Jul 2017 11:25:50 -0700 Subject: [PATCH] Shorten the view URI to /p/... --- server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index d0b9d7b..96a27a9 100644 --- a/server.go +++ b/server.go @@ -139,7 +139,7 @@ func (s *Server) PasteHandler() httprouter.Handle { uuid := shortuuid.NewWithNamespace(s.config.fqdn) s.store.Set(uuid, blob, cache.DefaultExpiration) - u, err := url.Parse(fmt.Sprintf("./view/%s", uuid)) + u, err := url.Parse(fmt.Sprintf("./p/%s", uuid)) if err != nil { http.Error(w, "Internal Error", http.StatusInternalServerError) } @@ -256,7 +256,7 @@ func (s *Server) initRoutes() { s.router.GET("/", s.IndexHandler()) s.router.POST("/", s.PasteHandler()) s.router.GET("/download/:uuid", s.DownloadHandler()) - s.router.GET("/view/:uuid", s.ViewHandler()) + s.router.GET("/p/:uuid", s.ViewHandler()) } // NewServer ...