Client Functions
This page will explain all exported functions from the SonoranCAD Core that can be used on the client side
getApiMode
Determines the API mode based on the configuration. This tells you which API URL is being used by the CAD for API Calls
exports.sonorancad.getApiMode()Type
Description
number
1for production mode (or if no mode is set in the configuration).
0for development mode.
-- Example: Determining the API mode
Config = { mode = "development" }
local apiMode = getApiMode()
print(apiMode) -- Output: 0 (development mode)
Config = { mode = nil }
local apiModeDefault = getApiMode()
print(apiModeDefault) -- Output: 1 (default to production mode)
Config = { mode = "production" }
local apiModeProd = getApiMode()
print(apiModeProd) -- Output: 1 (production mode)
Last updated
Was this helpful?

