diff --git a/modules/http/http.lua b/modules/http/http.lua index 39271c8..fb3e24d 100644 --- a/modules/http/http.lua +++ b/modules/http/http.lua @@ -1,6 +1,7 @@ -- modules/http.lua - Express-like HTTP server with pure Lua routing local http = {} +local json = require("json") -- Global routing tables (shared across all states) _G._http_routes = _G._http_routes or {} @@ -308,7 +309,7 @@ function Request:json() end local success, result = pcall(function() - return moonshark.json_decode(self.body) + return json.decode(self.body) end) if success then @@ -391,7 +392,7 @@ function Response:json(data) self:type("application/json") local success, json_str = pcall(function() - return moonshark.json_encode(data) + return json.encode(data) end) if success then