class FleetApp::ApiPath
- FleetApp::ApiPath
- Reference
- Object
Overview
An ApiPath is responsible for generating a URL path to initiate an action on
the fleet.
Defined in:
fleet_app/api_path.crConstant Summary
-
API_VERSION =
"v1" -
The API version that the fleet is currently using. As of 2024-02-13, we only have a "v1".
-
BASE_PATH =
"/api/#{API_VERSION}" -
The beginning part of the path that is generated.
Constructors
-
.new(game_name : String, server_id : String, host : String, action : String | Nil = nil, params : Hash(String, String) = {} of String => String)
Initializes an
ApiPathParameters: -game_nameis the underscored name of the game you want to perform an action on.
Instance Method Summary
-
#path : String
After initializing an
ApiPathwith your information, use this method to get the path.
Constructor Detail
def self.new(game_name : String, server_id : String, host : String, action : String | Nil = nil, params : Hash(String, String) = {} of String => String)
#
Initializes an ApiPath
Parameters:
game_nameis the underscored name of the game you want to perform an action on. See:FleetApp::Gamefor possible values.server_idis the server id from the valheimserverhosting app or GamesSite app that you want to perform an action on.actionis the name of the action.paramsrepresents the query params that will be encoded as a string at the end of the path.