Module: Backend

Methods

(inner) attempt(id, input, config)

Function to submit the chosen numbers.
Parameters:
Name Type Description
id number id of game being attempted
input Array.<number> numbers to be submitted
config object json object of game generation config
Source:

(inner) get/()

Index endpoint.
Source:

(inner) get/leaderboard()

Leaderboard endpoint.
Source:

(inner) get/logout()

Logout endpoint.
Source:

(inner) get/profile()

Profile endpoint.
Source:

(inner) post/attempt(id, input, count, minValue, maxValue)

Submission endpoint.
Parameters:
Name Type Description
id string ID of user's game
input Array.<number> Numbers guessed
count number (Config) Number of numbers to generate/were generated.
minValue number (Config) Minimum value of generated numbers.
maxValue number (Config) Maximum value of generated numbers.
Source:

(inner) post/auth(username, password)

Auth endpoint.
Parameters:
Name Type Description
username string Name of user to be logged in.
password string Password of user to be logged in.
Source:

(inner) validateOrCreateGame(id, config)

Function to either return an existing game or create a new one based on given id and config.
Parameters:
Name Type Description
id number id of game being attempted
config object json object of game generation config
Source: