Compare commits

..

3 Commits

Author SHA1 Message Date
8fc86d9fb6 feat: añadido reset al form de recorte 2026-03-18 16:30:24 -03:00
e4e400c3be feat: reformulado el generador de links para que no sean secuenciales 2026-03-18 16:24:44 -03:00
fba107e266 actualizado gitignore 2026-03-17 15:23:50 -03:00
4 changed files with 4 additions and 5 deletions

View File

@@ -10,7 +10,7 @@
href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap" href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap"
rel="stylesheet" rel="stylesheet"
/> />
<title>Acortador de Urls</title> <title>front</title>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@@ -13,7 +13,7 @@
onsubmit={async (e) => { onsubmit={async (e) => {
e.preventDefault(); e.preventDefault();
// console.log(e.target[0].value); // console.log(e.target[0].value);
// console.log($url); console.log($url);
const req = { longUrl: input.value }; const req = { longUrl: input.value };
try { try {
const res = await fetch(`${$url}/url/`, { const res = await fetch(`${$url}/url/`, {
@@ -22,7 +22,7 @@
}); });
if (res.ok) { if (res.ok) {
const data = await res.json(); const data = await res.json();
// console.log(data.shortUrl); console.log(data.shortUrl);
popup = data.shortUrl; popup = data.shortUrl;
} }
} catch { } catch {

View File

@@ -3,7 +3,6 @@ import { svelte } from "@sveltejs/vite-plugin-svelte";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
base: "./",
plugins: [svelte()], plugins: [svelte()],
server: { server: {
proxy: { proxy: {

View File

@@ -40,7 +40,7 @@ func CrearUrl(longURL string, db *gorm.DB) (string, error) {
var url models.Url var url models.Url
for { for {
url.Shorturl = int64(rand.Uint64()) url.Shorturl = rand.Int64()
result = db.Model(&models.Url{}).Where("shorturl = ?", url.Shorturl).Count(&counturl) result = db.Model(&models.Url{}).Where("shorturl = ?", url.Shorturl).Count(&counturl)
if result.Error != nil { if result.Error != nil {
return "", result.Error return "", result.Error