feat: terminada funcionalidad
actualmente funciona en dev falta cocinar deploy
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user