Backend para o jogo de truco da matéria de PIN3
- Criar virtual environment com
python -m venv env
- Ativar o virtual environment rodando o script
env/Scripts/activate
- instalar dependências com
pip install -r .\requirements.txt
- rodar
flask --app index run
no terminal para iniciar o server de desenvolvimento - Endpoint de produção: https://truco-server.vercel.app
POST /match
[
{
"id": 0,
"algorithm": "RANDOM"
},
{
"id": 1,
"algorithm": "BASELINE"
}
]
{
"matches": [
{
"joker": "2_MOLES",
"match_id": "894ffb5d",
"player_1": [
"7_COPAS",
"1_PAUS",
"11_COPAS"
],
"player_2": [
"1_ESPADAS",
"2_PAUS",
"3_MOLES"
],
"plays": [
{
"card": "3_MOLES",
"player": 1,
"type": "PLAY"
},
{
"card": "7_COPAS",
"player": 0,
"type": "PLAY"
},
{
"card": "1_ESPADAS",
"player": 1,
"type": "PLAY"
},
{
"card": "1_PAUS",
"player": 0,
"type": "PLAY"
},
{
"type": "TIE"
},
{
"player": 1,
"points": 1,
"type": "WIN"
}
],
"points": 1,
"winner": 1
},
[...]
],
"points": [
5,
13
],
"winner": 1
}
curl --location --request POST 'https://truco-server.vercel.app/match' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"id": 0,
"algorithm": "RANDOM"
},
{
"id": 1,
"algorithm": "BASELINE"
}
]'