Compare commits

...

2 Commits

Author SHA1 Message Date
bbab76bc7f remove refer
All checks were successful
Validate / Validate (push) Successful in 8s
2024-09-26 01:08:10 +02:00
833af735cf add env 2024-09-26 01:07:02 +02:00
5 changed files with 12 additions and 4 deletions

1
.env.example Normal file
View File

@ -0,0 +1 @@
PORT=8000

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
bunker
bunker.db
files/
.env

View File

@ -4,6 +4,8 @@
"indentWidth": 4
},
"tasks": {
"check": "deno check main.ts"
"check": "deno check main.ts",
"dev": "deno run -A --unstable-ffi --env main.ts",
"compile": "deno compile --allow-net --allow-read --allow-env --allow-write --allow-ffi --allow-run --unstable-ffi --env main.ts"
}
}

View File

@ -235,4 +235,4 @@ new oak.Application()
index: "index.html",
});
})
.listen({ port: 8000 });
.listen({ port: parseInt(Deno.env.get("PORT")!) });

View File

@ -25,7 +25,10 @@ document.querySelector("#login").onsubmit = async (event) => {
}
const refer = decodeURIComponent(params.get("refer"));
params.delete("refer")
window.location.search = params.toString();
if (params.size === 0) {
window.location.pathname = refer;
return;
}
window.location = `${refer}?${params.toString()}`;
};