feat: terminada funcionalidad

actualmente funciona en dev falta cocinar deploy
This commit is contained in:
2026-03-17 11:18:22 -03:00
parent 5906cae45e
commit 68ce52f7c8
7 changed files with 87 additions and 12 deletions

View File

@@ -34,8 +34,9 @@ func Url(w http.ResponseWriter, r *http.Request, db *gorm.DB) {
longUrl, err := repository.RecuperarUrl(paths[len(paths)-1], db)
if err != nil {
http.Error(w, "Error: "+err.Error(), http.StatusBadRequest)
return
}
http.Redirect(w, r, longUrl, http.StatusPermanentRedirect)
http.Redirect(w, r, longUrl, http.StatusMovedPermanently)
default:
http.Error(w, "404", http.StatusBadGateway)