Formatting + Added Home Page

This commit is contained in:
IM23a-spirgif
2025-04-17 13:56:44 +02:00
parent 31eb975007
commit 38ae2eb785
4 changed files with 31 additions and 10 deletions
+3 -3
View File
@@ -108,12 +108,12 @@ app.get("/", authenticateToken, (request, response) => {
response.sendFile(path.join(__dirname, ".\\public\\home.html"));
});
app.post("/balance", authenticateToken, (request, response) => {
app.get("/balance", authenticateToken, (request, response) => {
/* #swagger.security = [{
"bearerAuth": []
}] */
const username = request.user.username;
console.log(username);
const allUsers = get_data();
const me = allUsers.find(u => u.username === username);
@@ -121,7 +121,7 @@ app.post("/balance", authenticateToken, (request, response) => {
return response.status(404).json({ error: "User not found" });
}
response.json({ balance: me.money });
response.json({ balance: me.money }).status(200);
});
app.post("/verify", authenticateToken, (request, response) => {