diff --git a/Makefile b/Makefile index 3b07436..b9fcc3c 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,9 @@ NODEMCU-UPLOADER=../nodemcu-uploader/nodemcu-uploader.py # Serial port PORT=/dev/cu.SLAB_USBtoUART -SPEED=9600 +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/README.md b/README.md index 5d01052..a7a0930 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,13 @@ Let the abuse begin. 4. How to use HTTP Basic Authentication. - Enable and configure HTTP Basic Authentication by editing "httpserver-conf.lua" file. + Modify variables in configuration file httpserver-conf.lua in order to enable and to configure usernames/passwords. + See comments in that file for more details. When enabled, HTTP Basic Authentication is global to every file served by the server. Remember that HTTP Basic Authentication is a very basic authentication protocol, and should not be - considered secure if the server is not using encryption, as your username and password travel + considered as secure since the server is not using encryption. Username and passwords travel in plain text. ## How to use server-side scripting using your own Lua scripts diff --git a/http/cars.html b/http/cars.html index 6467a8b..41793aa 100644 --- a/http/cars.html +++ b/http/cars.html @@ -1,17 +1,21 @@ - - - Nice cars - - -

Nice cars!

-

This page loads "large" images of fancy cars. It is meant to serve as a stress test for nodemcu-httpserver.

-
Ferrari
-
Lamborghini
-
Maserati
-
Porsche
- + + + Nice cars + + +

Nice cars!

+

+ This page loads "large" images of fancy cars. It is meant to serve as a stress test for nodemcu-httpserver.
+ It works with three embedded images of cars, but the server crashes with four. Edit this file and try it yourself.
+ Whoever manages to modify nodemcu-httpserver to load all four images without crashing wins a prize! +

+
Ferrari
+
Lamborghini
+
Maserati
+
Porsche
+ diff --git a/http/file_list.lua b/http/file_list.lua index 2935ec8..d994043 100644 --- a/http/file_list.lua +++ b/http/file_list.lua @@ -7,12 +7,16 @@ return function (connection, req, args)

Server File Listing

]===]) - local remaining, used, total=file.fsinfo() + local remaining, used, total = file.fsinfo() connection:send("Total size: " .. total .. " bytes
\n" .. "In Use: " .. used .. " bytes
\n" .. - "Free: " .. remaining .. " bytes
\n" .. - "

\nFiles:
\n