diff --git a/Makefile b/Makefile index 3536d60..b9fcc3c 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,8 @@ NODEMCU-UPLOADER=../nodemcu-uploader/nodemcu-uploader.py PORT=/dev/cu.SLAB_USBtoUART SPEED=115200 +NODEMCU-COMMAND=$(NODEMCU-UPLOADER) -b $(SPEED) --start_baud $(SPEED) -p $(PORT) upload + ###################################################################### # End of user config ###################################################################### @@ -33,17 +35,17 @@ usage: # Upload one files only upload: - @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(FILE) + @python $(NODEMCU-COMMAND) $(FILE) # Upload HTTP files only upload_http: $(HTTP_FILES) - @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f)) + @python $(NODEMCU-COMMAND) $(foreach f, $^, $(f)) # Upload httpserver lua files (init and server module) upload_server: $(LUA_FILES) - @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f)) + @python $(NODEMCU-COMMAND) $(foreach f, $^, $(f)) # Upload all upload_all: $(LUA_FILES) $(HTTP_FILES) - @python $(NODEMCU-UPLOADER) -b $(SPEED) -p $(PORT) upload $(foreach f, $^, $(f)) + @python $(NODEMCU-COMMAND) $(foreach f, $^, $(f)) diff --git a/httpserver-header.lua b/httpserver-header.lua index 3e6fabc..3010492 100644 --- a/httpserver-header.lua +++ b/httpserver-header.lua @@ -13,7 +13,8 @@ return function (connection, code, extension, isGzipped) local function getMimeType(ext) -- A few MIME types. Keep list short. If you need something that is missing, let's add it. - local mt = {css = "text/css", gif = "image/gif", html = "text/html", ico = "image/x-icon", jpeg = "image/jpeg", jpg = "image/jpeg", js = "application/javascript", json = "application/json", png = "image/png", xml = "text/xml"} + local mt = {css = "text/css", gif = "image/gif", html = "text/html", ico = "image/x-icon", jpeg = "image/jpeg", + jpg = "image/jpeg", js = "application/javascript", json = "application/json", png = "image/png", xml = "text/xml"} if mt[ext] then return mt[ext] else return "text/plain" end end