|
před 3 roky | |
---|---|---|
client | před 3 roky | |
server | před 3 roky | |
.drone.yml | před 3 roky | |
.gitignore | před 3 roky | |
README.md | před 3 roky |
API Endpoints
GET /health
Returns 200 and {
"version": string,
"status": string
}
POST /score
Accepts {
"point1": {
"lat": number,
"lng": number
},
"point2": {
"lat": number,
"lng": number
}
}
Returns 400 or 200 and {
"score": number,
"distance": number
}
GET /caches
Returns 200 and {
"caches": [
{
"generationMethod": string,
"countryLock": string || null,
"size": number
}, ...
]
}
GET /generators
Returns 404 vs 200 and {
"generators": [
{
"generationMethod": string,
"countryLocks": [ string ],
}
]
}
GET /recent
Returns 200 and {
"recentGames": [ string ]
}
PUT /game
Accepts {
"timer": number,
"rounds": number,
"countryLock": string || null (default: null),
"generationMethod": string (default: "RANDOMSTREETVIEW"),
"gameMode": string (default: "NORMAL"),
"clockMode": string (default: "NORMAL"),
"scoreMethod": string (default: "DISTANCE"),
"roundPointCap": int || null (default: null)
}
Returns 501 vs 200 and {
"gameId": string
}
GET /game/{game_id}/config
Returns 404 vs 200 and {
"timer": number,
"rounds": number,
"countryLock": string || null,
"generationMethod": string,
"gameMode": string,
"clockMode": string,
"scoreMethod": string,
"roundPointCap": int || null
}
GET /game/{game_id}/coords
Returns 404 vs 200 and {
"1": {
"lat": number,
"lng": number,
"country": string || null,
}, ...
}
POST /game/{game_id}/join
Accepts {
"playerName": string
}
Returns (404, 409) vs 201 and {
"playerId": string
}
GET /game/{game_id}/players
Returns 404 vs 200 and {
"players": [
{
"name": string,
"currentRound": string || null,
"totalScore": number,
"guesses": {
"1": {
"lat": number,
"lng": number,
"country": string || null,
"score": number || null,
"timeRemaining": number
}, ...
}
}, ...
]
}
GET /game/{game_id}/players/{player_id}/current
Returns 404 vs 200 and {
"currentRound": string || null,
"coord": {
"lat": number,
"lng": number,
"country": string || null,
} || null,
"timer": number || null
}
GET /game/{game_id}/linked
Returns 404 vs 200 and {
"linkedGame": string || null
}
PUT /game/{game_id}/linked
Accepts {
"linkedGame": string
}
Returns (401, 404) vs 201
GET /game/{game_id}/round/{round}/first
Returns 200 and {
"first": string || null
}
POST /game/{game_id}/round/{round}/guess/{player_id}
Accepts {
"timeRemaining": number,
"lat": number,
"lng": number
}
Returns (404, 409) vs 201 and {
"totalScore": number,
"score": number,
"distance": number
}
POST /game/{game_id}/round/{round}/timeout/{player_id}
Returns (404, 409) vs 201 and {
"totalScore": number
}
Change the proxy line in package.json to point to live vs local server
"proxy": "https://hiram.services/",
"proxy": "http://localhost:5000/",
None currently! Submit ideas!
Urban game data is based on the World Cities Database
Chime sound effect is Mike Koenig's Japanese Temple Bell Small