From e9b97d7f4ebb84d0ec40ba5e6a0e6589a42f309e Mon Sep 17 00:00:00 2001 From: Konotorii <79553360+konotorii@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:38:26 -0400 Subject: [PATCH] fix: Screenshots correct directory and return link --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9034577..8090462 100644 --- a/main.go +++ b/main.go @@ -124,13 +124,13 @@ func postImage(c *gin.Context) { consola.Log(file.Filename) // Upload the file to specific dst. - err := c.SaveUploadedFile(file, "/public/ss") + err := c.SaveUploadedFile(file, "/public/screenshots") if err != nil { consola.Error(err) c.Status(500) } - c.JSON(200, fmt.Sprintf("{\"url\":\"https://img.kono.services/ss/%s\"}", file.Filename)) + c.JSON(200, gin.H{"url": fmt.Sprintf("https://img.kono.services/img?path=screenshots/%p", file.Filename)}) } else { c.Status(400) }