Acts as the server for the Camera-Shy game
The server currently uses a REST API implemented in ExpressJS and NodeJS. This makes client updates not very efficient. We plan to continue work on the game, transitioning it to websockets, for real-time client-server updates. Development is happening when I have free-time to invest in the project.
Can be installed by running
npm install
Used to create a Game
{
appleId: string,
numPlayers: number,
time: number,
lat: number,
long: number,
bound: [number],
rad: number
}
Status Code 200
Success, the Game was created. gameId is used to join
{ gameId: gameId }
Also sends OneSig Notif to Host:
Title: "Game Created!"
Text: "Join code: " + gameId,
Status Code 404
Host's appleId doesn't exist
{error: "Host doesn't exist!"}
Status Code 500
Some other error
{error: "error text"}
Used to create a User
{
name: string,
id: number, // Apple Login ID
osId: number // One Signal ID
}
Image of face. Field Name: img
Status Code 200
Success, the User was created. appleId is used to reference User
Status Code 500
Some other error
{error: "error text"}
Used to get the URL of all files in the Gallery
None
Status Code 200
Success.
{ fnames: [
// Relative file URLs
"/uploads/file.jpg",
"/uploads/file.png"
]
}
Will return empty array if there are no images in Gallery.
Status Code 500
Some other error
{error: "error text"}
Used to get the URL of the avatar for the User with appleId
{ appleId: string }
Status Code 200
Success.
{ avatarUrl: string }
Status Code 404
Error: User with appleId does not exist
{ error: `User with appleId ${appleId} does not exist` }
Status Code 500
Some other error
{error: "error text"}
Used to get the number of Users in the Game with gameId
{ gameId: string }
Status Code 200
Success.
{ numPlayers: number }
Status Code 404
Error: Game with gameId does not exist.
{ error: `Game with gameId ${gameId} does not exist` }
Status Code 500
Some other error
{error: "error text"}