pm2 is used to daemonize the express instance and then reverse proxied by nginx. The https is handled by certbot (LetsEncrpyt).
In order to restart the instance for any reason, use "pm2 restart 0".
- AUTH_TOKEN: A token recieved from /players/token/email/{email}/password/{password}
- OPTIONAL: This field of the body is optional, however one of the optional field is neccesary
{
battle_id: INT id of current battle,
d_psychic_powers: INT number of enemy units destroyed with psychic powers in this battle by this unit,
d_ranged: INT number of enemy units destroyed with ranged weapons in this battle by this unit,
d_melee: INT number of enemy units destroyed with melee weapons in this battle by this unit,
agenda_1: INT tally of how many times this unit accomplished the first agenda in this battle,
agenda_2: INT tally of how many times this unit accomplished the second agenda in this battle,
agenda_3: INT tally of how many times this unit accomplished the third agenda in this battle,
victory: BOOLEAN TRUE if the associated unit was victorious in this battle, FALSE if they were not victorious,
unit: STRING name of the associated unit,
force: STRING name of the force associated with the above unit,
unit_id: INT id of the unit associated with this battle,
force_id: INT id of the force that contains the unit associated with this battle,
}
-
- Purpose: Retrieve all battles in relation
- Return: An array of battle objects
-
- Purpose: Retrieve specific battle with provided {id}
- Return: A battle object
-
- Purpose: Retrieve all battles assiciated with unit that has the provided {id}
- Return: An array of battle objects
-
- Purpose: Retrieve all battles assiciated with the force that has the provided {id}
- Return: An array of battle objects
-
-
Purpose: Create a new battle
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- unit: INT unit id who fought the battle
- d_psychic_powers: INT number of enemy units destroyed with psychic powers in this battle by this unit,
- d_ranged: INT number of enemy units destroyed with ranged weapons in this battle by this unit,
- d_melee: INT number of enemy units destroyed with melee weapons in this battle by this unit,
- agenda_1: INT tally of how many times this unit accomplished the first agenda in this battle,
- agenda_2: INT tally of how many times this unit accomplished the second agenda in this battle,
- agenda_3: INT tally of how many times this unit accomplished the third agenda in this battle,
- victory: BOOLEAN TRUE if the associated unit was victorious in this battle, FALSE if they were not victorious,
-
Return: 201 status with the url endpoint to retrieve this battle in the form of /battles/{id}
-
-
-
Purpose: Update a column of a battle, if the column isn't included in the body than it won't be updated
-
Header:
- x-access-token: AUTH_TOKEN
-
Body: 1 or more column is required
- id: INT the id of the battle that is being updated
- d_psychic_powers: INT OPTIONAL number of enemy units destroyed with psychic powers in this battle by this unit,
- d_ranged: INT OPTIONAL number of enemy units destroyed with ranged weapons in this battle by this unit,
- d_melee: INT OPTIONAL number of enemy units destroyed with melee weapons in this battle by this unit,
- agenda_1: INT OPTIONAL tally of how many times this unit accomplished the first agenda in this battle,
- agenda_2: INT OPTIONAL tally of how many times this unit accomplished the second agenda in this battle,
- agenda_3: INT OPTIONAL tally of how many times this unit accomplished the third agenda in this battle,
- victory: BOOLEAN OPTIONAL TRUE if the associated unit was victorious in this battle, FALSE if they were not victorious,
-
Return: Status code 200
-
-
-
Purpose: Add 1 to the tally of enemies defeated by psychic powers
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Subtract 1 to the tally of enemies defeated by psychic powers
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Add 1 to the tally of enemies defeated with ranged weapons
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Subtract 1 to the tally of enemies defeated with ranged weapons
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Add 1 to the tally of enemies defeated with melee weapons
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Subtract 1 to the tally of enemies defeated with melee weapons
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Add 1 to the tally of how many times the unit accomplished the first agenda
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Subtract 1 to the tally of how many times the unit accomplished the first agenda
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Add 1 to the tally of how many times the unit accomplished the second agenda
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Subtract 1 to the tally of how many times the unit accomplished the second agenda
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Add 1 to the tally of how many times the unit accomplished the third agenda
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Subtract 1 to the tally of how many times the unit accomplished the third agenda
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
-
-
Purpose: Delete a battle
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT The id for the battle
-
Return: Status code 200
-
{
faction_id: INT the id of the faction
name: STRING the name of the faction
description: STRING a short description of the faction
}
-
- Purpose: Retrieve all factions in relation
- Return: An array of faction objects
-
- Purpose: Retrieve specific faction with provided {id}
- Return: A faction object
{
force_id: INT the id of the force
name: STRING the name of the force
battle_tally: INT a tally of the total battles this force has fought
battles_won: INT a tally of the total battles this force has won
requisition_points: INT number of requision points this force has
supply_limit: INT the supply limit of this force
supply_used: INT the total amount of supply used
faction_id: INT the id of the faction of the force
faction: STRING the name of the faction
owner_id: INT the id of the player who owns this force
owner: STRING the name of the player who owns this force
}
-
- Purpose: Retrieve all forces in relation
- Return: An array of force objects
-
- Purpose: Retrieve specific force with provided {id}
- Return: A force object
-
- Purpose: Retrieve forces that are owned by the player associated with {id}
- Return: An array of force objects
-
-
Purpose: Create a new force
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- faction_id: INT a faction_id from a row of factions table
- supply_type: INT a type_id from a row of supply_types table
- name: STRING the name of this force
-
Return: Status code 201 and location on where to retrieve the created row in the location of the status body
-
-
-
Purpose: Update various columns in the specified force
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force being updated
- name: STRING OPTIONAL the name of this force
- battle_tally: INT OPTIONAL the tally of battles fought by this force
- battles_won: INT OPTIONAL the tally of battles won by this force
- requisition_points: INT OPTIONAL the number of points this force currently has
- supply_limit: INT OPTIONAL the supply that this force can use
- supply_used: INT OPTIONAL the amount of supply used by this force
- faction_id: INT OPTIONAL the id of the faction this force belongs to
- supply_type: INT OPTIONAL the type of supply this force uses, either points or power level
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to add to the supply used, it will return a status code 405 if the new amount is more than the supply limit
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to subtract from the supply used, it silently set it to 0 if the subtracted amount is lower than 0
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to add to the supply limit, there is no upper limit to this
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to subtract from the supply limit, it silently set it to 0 if the subtracted amount is lower than 0
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to add to the requisition points, it returns status code 405 if the new amount is more than 5
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to subtract from the requisition points, it silently set it to 0 if the subtracted amount is lower than 0
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to add to the battle tally, there is not upper limit to this
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to subtract from the battle tally, it silently set it to 0 if the subtracted amount is lower than 0
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to add to the battles won, it will return status code 405 if more than battle tally
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Shorthand endpoint to subtract from the battles won, it silently set it to 0 if the subtracted amount is lower than 0
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the force
- amount: INT the amount that the supply_used is to be changed
-
Return: Status code 200
-
-
-
Purpose: Deletes this force
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT id of the force to be deleted
-
Return: Status code 200
-
{
goal_id: INT unique id of goal
text: STRING the description of the goal
title: STRING a short summary of the goal
force: INT the id of the force from the force table
created_at: TIMESTAMP the time that this goal was entered into the database
}
-
- Purpose: Retrieve all goals in relation
- Return: An array of goal objects
-
- Purpose: Retrieve specific goal with provided {id}
- Return: A goal object
-
- Purpose: Retrieve goals that are owned by the force associated with {id}
- Return: An array of goal objects
-
-
Purpose: Creates a new goal
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- force: INT An id from the force table of the force that this goal is associated with
- title: STRING A one line summary of the goal
- text: STRING An in depth description of the goal
-
Return: Status code 201 and location on where to retrieve the created row in the location of the status body
-
-
-
Purpose: Updates various columns in a goal
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the goal to be updated
- title: STRING OPTIONAL A one line summary of the goal
- text: STRING OPTIONAL An in depth description of the goal
-
Return: Status code 200
-
-
-
Purpose: Deletes a goal
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the goal to be deleted
-
Return: Status code 200
-
{
information_id: INT unique id of the piece of information
text: STRING the description of the piece of information
title: STRING a short summary of the piece of information
force: INT the id of the force from the force table
created_at: TIMESTAMP the time that this piece of information was entered into the database
}
-
- Purpose: Retrieve all information in relation
- Return: An array of information objects
-
- Purpose: Retrieve a specific piece of information with provided {id}
- Return: A information object
-
- Purpose: Retrieve information that are owned by the force associated with {id}
- Return: An array of information objects
-
-
Purpose: Creates a new piece of information
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- force: INT An id from the force table of the force that this piece of information is associated with
- title: STRING A one line summary of the piece of information
- text: STRING An in depth description of the piece of information
-
Return: Status code 201 and location on where to retrieve the created row in the location of the status body
-
-
-
Purpose: Updates various columns in a piece of information
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the piece of information to be updated
- title: STRING OPTIONAL A one line summary of the piece of information
- text: STRING OPTIONAL An in depth description of the piece of information
-
Return: Status code 200
-
-
-
Purpose: Deletes a piece of information
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the piece of information to be deleted
-
Return: Status code 200
-
{
player_id: INT the id of the player
display_name: STRING the name of the player
email: STRING the email of the player
}
-
- Purpose: Retrieve all players in relation
- Return: An array of player objects
-
- Purpose: Retrieve specific player with provided {id}
- Return: A player object
-
- Purpose: Retrieve an AUTH_TOKEN
- Return: An AUTH_TOKEN variable at token
-
-
Purpose: Creates a player
-
Body:
- display_name: STRING The display name of the new player
- email: STRING The email of the new player
- password: STRING The password of the new player
-
Return: Status code 201 and location on where to retrieve the created row in the location of the status body
-
-
-
Purpose: Updates various columns in a specific player
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- display_name: STRING OPTIONAL The value for diplay name to be changed to
- email: STRING OPTIONAL The value for email to be changed to
- password: STRING OPTIONAL The value for password to be changed to
-
Return: Status code 200
-
-
-
Purpose: Deletes a player
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
-
Return: Status code 200
-
{
rank_id: INT the id of the rank
name: STRING the name of the rank
}
-
- Purpose: Retrieve all ranks in relation
- Return: An array of rank objects
-
- Purpose: Retrieve specific rank with provided {id}
- Return: A rank object
{
role_id: INT the id of the role
name: STRING the name of the role
}
-
- Purpose: Retrieve all roles in relation
- Return: An array of role objects
-
- Purpose: Retrieve specific role with provided {id}
- Return: A role object
{
role_id: INT the id of the supply type
name: STRING the name of the supply type
}
-
- Purpose: Retrieve all supply types in relation
- Return: An array of supply type objects
-
- Purpose: Retrieve specific supply type with provided {id}
- Return: A supply type object
{
unit_id: INT the id of the unit
name: STRING the name of the unit
keywords: STRING the unit's selectable keywords, such as dynasty or chapter
unit_type: STRING name of the unit from the datasheet (such as Necron Warriors or Primaris intercessors)
equipment: STRING the list of selectable equpiment on the models of the unit
psychic_powers: STRING a list of powers known to the unit if they are psykers
warlord_traits: STRING the warlord traits of this unit if it is a warlord
power_rating: INT the power of the unit, either in points or power level
experience_points: INT the exp of the unit
crusade_points: INT an accumulation of things as the unit fights, usually the relics or requisition will say how many points it adds
other_abilities: STRING anything that's not covered above, such as C'Tan powers
battle_honors: STRING battles honors earned through victories
battle_scars: STRING battles scars earned through defeat
relics: STRING the relics this unit has collected throughout the crusade
faction: STRING the name of the faction this unit belongs to
faction_des: STRING the description of the faction this unit belongs to
role: STRING the battefield role this unit occupies such as troop or HQ
rank: STRING name of the rank that this unit as attained
force: STRING name of the force this unit belongs to
force_id: INT the id of the force that this unit belongs to
}
-
- Purpose: Retrieve all units in relation
- Return: An array of unit objects
-
- Purpose: Retrieve specific unit with provided {id}
- Return: A unit object
-
- Purpose: Retrieve all units of a force
- Return: An array of unit objects
-
-
Purpose: Creates a unit
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- name: STRING The name of the new unit
- role: STRING The role of the new unit
- faction: INT The id of the faction that this unit belongs to
- keywords: STRING Selectable keywords
- unit_type: STRING The name of the unit from the codex
- equipment: STRING the list of selectable equpiment that this unit uses
- power_rating: INT the power_rating of this unit, either points or power level
- other_abilities: STRING any abilities not handled above
- rank: INT id from the rank table
- battle_honors: STRING a list of battles honors
- battle_scars: STRING a list of battle scars
- relics: STRING a list of relics
- force: INT the id from the forces table
-
Return: Status code 201 and location on where to retrieve the created row in the location of the status body
-
-
-
Purpose: Updates various columns in a specific unit
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the unit to be updated
- name: STRING OPTIONAL display name of the unit
- faction: INT OPTIONAL id from factions table
- keywords: STRING OPTIONAL
- unit_type: STRING OPTIONAL
- equipment: STRING OPTIONAL
- psychic_powers: STRING OPTIONAL
- warlord_traits: STRING OPTIONAL
- power_rating: INT OPTIONAL
- crusade_points: INT OPTIONAL
- experience_points: INT OPTIONAL
- other_abilities: STRING OPTIONAL
- rank: INT OPTIONAL id from rank table
- battle_honors: STRING OPTIONAL
- battle_scars: STRING OPTIONAL
- relics: STRING OPTIONAL
-
Return: Status code 200
-
-
-
Purpose: Deletes a unit
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the unit to be deleted
-
Return: Status code 200
-
{
victory_id: INT unique id of the victory
text: STRING the description of the victory
title: STRING a short summary of the victory
force: INT the id of the force from the force table
created_at: TIMESTAMP the time that this victory was entered into the database
}
-
- Purpose: Retrieve all victories in relation
- Return: An array of victories objects
-
- Purpose: Retrieve a specific victory with provided {id}
- Return: A victories object
-
- Purpose: Retrieve victories that are owned by the force associated with {id}
- Return: An array of victories objects
-
-
Purpose: Creates a new victory
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- force: INT An id from the force table of the force that this victory is associated with
- title: STRING A one line summary of the victory
- text: STRING An in depth description of the victory
-
Return: Status code 201 and location on where to retrieve the created row in the location of the status body
-
-
-
Purpose: Updates various columns in a victory
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the victory to be updated
- title: STRING OPTIONAL A one line summary of the victory
- text: STRING OPTIONAL An in depth description of the victory
-
Return: Status code 200
-
-
-
Purpose: Deletes a victory
-
Header:
- x-access-token: AUTH_TOKEN
-
Body:
- id: INT the id of the victory to be deleted
-
Return: Status code 200
-