forked from marcoskirsch/nodemcu-httpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttpserver-compile.lua
More file actions
33 lines (29 loc) · 789 Bytes
/
httpserver-compile.lua
File metadata and controls
33 lines (29 loc) · 789 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- httpserver-compile.lua
-- Part of nodemcu-httpserver, compiles server code after upload.
-- Author: Marcos Kirsch
local compileAndRemoveIfNeeded = function(f)
if file.exists(f) then
print('Compiling:', f)
node.compile(f)
file.remove(f)
collectgarbage()
end
end
local serverFiles = {
'httpserver.lua',
'httpserver-b64decode.lua',
'httpserver-basicauth.lua',
'httpserver-compile.lua',
'httpserver-conf.lua',
'httpserver-connection.lua',
'httpserver-error.lua',
'httpserver-header.lua',
'httpserver-init.lua',
'httpserver-request.lua',
'httpserver-static.lua',
'httpserver-wifi.lua',
}
for i, f in ipairs(serverFiles) do compileAndRemoveIfNeeded(f) end
compileAndRemoveIfNeeded = nil
serverFiles = nil
collectgarbage()