Merge remote-tracking branch 'origin/main'

This commit is contained in:
IM23a-spirgif
2025-04-17 13:21:31 +02:00
3 changed files with 22 additions and 166 deletions
+1 -18
View File
@@ -1,20 +1,3 @@
[ [
{
"username": "jerome",
"password": "Sigma",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Implcm9tZSIsImlhdCI6MTc0NDg3NDQ2MCwiZXhwIjoxNzQ0ODc2MjYwfQ.4FnQwoi25uSs8VQWBgC3MRvaZfqcoDN8041fky4YDo4",
"money": 200
},
{
"username": "Gianimon",
"password": "gianimon",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IkdpYW5pbW9uIiwiaWF0IjoxNzQ0ODc0NTczLCJleHAiOjE3NDQ4NzYzNzN9.dGp5WTKIDVhomKZ8J7nevz8O7PqwRhR9wEgeyDtL_XE",
"money": 200
},
{
"username": "any",
"password": "any",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImFueSIsImlhdCI6MTc0NDg3OTQ1NCwiZXhwIjoxNzQ0ODgxMjU0fQ.xTV0yfMBO0BTsmggjouwYrx180un9rHiDljQqN6IUdw",
"money": 200
}
] ]
+20
View File
@@ -0,0 +1,20 @@
const express = require("express");
const app = express();
const port = 3000;
async function createLobby() {
let response = await fetch("https://www.deckofcardsapi.com/api/deck/new/shuffle/?deck_count=1")
let data = await response.json();
let lobbyId = data.deck_id
console.log(lobbyId);
return lobbyId;
}
app.get("/lobby/create", async (req, res) => {
let lobbyId = await createLobby();
res.send("Lobby ID: " + lobbyId);
})
app.listen(port, () => {
console.log("Server is running on port " + port);
});
-147
View File
@@ -1,147 +0,0 @@
{
"openapi": "3.0.0",
"info": {
"title": "GAMBLE!",
"description": "Gambling API",
"version": "1.0.0"
},
"servers": [
{
"url": "http://localhost:3000/"
}
],
"paths": {
"/register": {
"post": {
"description": "",
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"username": {
"example": "any"
}
}
}
}
}
}
}
},
"/login": {
"post": {
"description": "",
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
}
},
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"username": {
"example": "any"
}
}
}
}
}
}
}
},
"/": {
"get": {
"description": "",
"parameters": [
{
"name": "authorization",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
}
}
},
"/verify": {
"post": {
"description": "",
"parameters": [
{
"name": "authorization",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
}
}
},
"/logout": {
"delete": {
"description": "",
"parameters": [
{
"name": "authorization",
"in": "header",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "OK"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
}
}
}
}
}
}