dofile("local_config.lua") dofile("config.lua") -- Compile server code and remove original .lua files. -- This only happens the first time afer the .lua files are uploaded. local compileAndRemoveIfNeeded = function(f) if file.open(f) then file.close() print('Compiling:', f) node.compile(f) file.remove(f) collectgarbage() end end local serverFiles = { 'httpserver.lua', 'httpserver-b64decode.lua', 'httpserver-basicauth.lua', 'httpserver-conf.lua', 'httpserver-connection.lua', 'httpserver-error.lua', 'httpserver-header.lua', 'httpserver-request.lua', 'httpserver-static.lua', 'telnetserver.lua' } for i, f in ipairs(serverFiles) do compileAndRemoveIfNeeded(f) end compileAndRemoveIfNeeded = nil serverFiles = nil collectgarbage() -- some diagnostic print('chip: ',node.chipid()) print('heap: ',node.heap()) dofile("main.lua")