mirror of
https://github.com/gmod-integration/lua.git
synced 2025-03-15 21:17:34 +00:00
add dev url on debug
This commit is contained in:
parent
32e3310f65
commit
f3aae78525
|
@ -29,7 +29,15 @@ if (!GWSockets) then
|
|||
return
|
||||
end
|
||||
|
||||
local socket = GWSockets.createWebSocket("wss://ws.gmod-integration.com")
|
||||
local function getWebSocketURL()
|
||||
local url = "wss://ws.gmod-integration.com"
|
||||
if (gmInte.config.debug && gmInte.config.wssDebug) then
|
||||
url = gmInte.config.wssDebug
|
||||
end
|
||||
return url
|
||||
end
|
||||
|
||||
local socket = GWSockets.createWebSocket(getWebSocketURL())
|
||||
|
||||
// Authentication
|
||||
socket:setHeader("id", gmInte.config.id)
|
||||
|
|
|
@ -25,6 +25,14 @@ local function errorMessage(body, code)
|
|||
end
|
||||
end
|
||||
|
||||
local function getAPIURL()
|
||||
local url = "https://api.gmod-integration.com"
|
||||
if (gmInte.config.debug && gmInte.config.apiDebug) then
|
||||
url = gmInte.config.apiDebug
|
||||
end
|
||||
return url
|
||||
end
|
||||
|
||||
local function sendHTTP(params)
|
||||
// Log the HTTP request
|
||||
gmInte.log("HTTP Request: " .. params.method .. " " .. params.endpoint, true)
|
||||
|
@ -32,7 +40,7 @@ local function sendHTTP(params)
|
|||
|
||||
// Send the HTTP request
|
||||
HTTP({
|
||||
url = "https://api.gmod-integration.com" .. params.endpoint,
|
||||
url = getAPIURL() .. params.endpoint,
|
||||
method = params.method,
|
||||
headers = {
|
||||
["Content-Type"] = "application/json",
|
||||
|
|
Loading…
Reference in New Issue
Block a user