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