Hi,
I have a service that writes a json file to the scratch directory, however I have not had success reading that file from node.lua.
I have tried:
local json_file_path = SCRATCH .. "/data.json"
util.file_watch(json_file_path, function(content)
local data = json.decode(content)
amount = data.amount
record = data.record
end)
but I receive,
attempt to concatenate global 'SCRATCH' (a nil value)
I have also tried node.make_nested(), passing the direct path to the scratch directory, without success.
How can I correctly read the data.json saved in the scratch directory from Lua?