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
ApiPath
Parameters: -game_name
is the underscored name of the game you want to perform an action on.
Instance Method Summary
-
#path : String
After initializing an
ApiPath
with 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_name
is the underscored name of the game you want to perform an action on. See:FleetApp::Game
for possible values.server_id
is the server id from the valheimserverhosting app or GamesSite app that you want to perform an action on.action
is the name of the action.params
represents the query params that will be encoded as a string at the end of the path.