diff --git a/serve.go b/serve.go index ed30bea..95e8f13 100644 --- a/serve.go +++ b/serve.go @@ -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)