This commit is contained in:
2025-08-06 19:31:38 +02:00
parent b8766e37c1
commit 17a9c5835e

View File

@@ -23,6 +23,9 @@ func (s *Server) Admin() *fiber.App {
a.Post("/shorten", func(c *fiber.Ctx) error {
shortUrl := c.Query("s")
if shortUrl == "" {
shortUrl = s.serverGen.NextID()
}
longUrl := string(c.Body())
return s.storage.Put(shortUrl, longUrl)