Compare commits
2 Commits
fix_ap_set
...
use_file_e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
363c7a8dd5 | ||
|
|
b5baf6cd48 |
@@ -3,8 +3,7 @@
|
||||
-- Author: Marcos Kirsch
|
||||
|
||||
local compileAndRemoveIfNeeded = function(f)
|
||||
if file.open(f) then
|
||||
file.close()
|
||||
if file.exists(f) then
|
||||
print('Compiling:', f)
|
||||
node.compile(f)
|
||||
file.remove(f)
|
||||
|
||||
@@ -20,9 +20,10 @@ if (conf.wifi.mode == wifi.SOFTAP) or (conf.wifi.mode == wifi.STATIONAP) then
|
||||
conf.wifi.accessPoint.config = {}
|
||||
conf.wifi.accessPoint.config.ssid = "ESP-"..node.chipid() -- Name of the WiFi network to create.
|
||||
conf.wifi.accessPoint.config.pwd = "ESP-"..node.chipid() -- WiFi password for joining - at least 8 characters
|
||||
conf.wifi.accessPoint.net = {}
|
||||
conf.wifi.accessPoint.net.ip = "192.168.111.1"
|
||||
conf.wifi.accessPoint.net.netmask="255.255.255.0"
|
||||
conf.wifi.accessPoint.net.gateway="192.168.111.1" }
|
||||
conf.wifi.accessPoint.net.gateway="192.168.111.1"
|
||||
end
|
||||
-- These apply only when connecting to a router as a client
|
||||
if (conf.wifi.mode == wifi.STATION) or (conf.wifi.mode == wifi.STATIONAP) then
|
||||
|
||||
@@ -61,19 +61,19 @@ return function (port)
|
||||
uri.args = {code = 400, errorString = "Bad Request", logFunction = log}
|
||||
fileServeFunction = dofile("httpserver-error.lc")
|
||||
else
|
||||
local fileExists = file.open(uri.file, "r")
|
||||
file.close()
|
||||
local fileExists = false
|
||||
|
||||
if not fileExists then
|
||||
if not file.exists(uri.file) then
|
||||
-- print(uri.file .. " not found, checking gz version...")
|
||||
-- gzip check
|
||||
fileExists = file.open(uri.file .. ".gz", "r")
|
||||
file.close()
|
||||
|
||||
if fileExists then
|
||||
--print("gzip variant exists, serving that one")
|
||||
if file.exists(uri.file .. ".gz") then
|
||||
-- print("gzip variant exists, serving that one")
|
||||
uri.file = uri.file .. ".gz"
|
||||
uri.isGzipped = true
|
||||
fileExists = true
|
||||
end
|
||||
else
|
||||
fileExists = true
|
||||
end
|
||||
|
||||
if not fileExists then
|
||||
|
||||
Reference in New Issue
Block a user