diff --git a/http/cars-bugatti.jpg b/http/cars-bugatti.jpg new file mode 100644 index 0000000..3a0c051 Binary files /dev/null and b/http/cars-bugatti.jpg differ diff --git a/http/cars-mercedes.jpg b/http/cars-mercedes.jpg new file mode 100644 index 0000000..f426c00 Binary files /dev/null and b/http/cars-mercedes.jpg differ diff --git a/http/cars.lua b/http/cars.lua new file mode 100644 index 0000000..47282cd --- /dev/null +++ b/http/cars.lua @@ -0,0 +1,51 @@ +return function (connection, req, args) + + local function showCars(nr) + if not nr then return end + connection:send([===[
Ferrari
]===]) + if nr == "1" then return end + connection:send([===[
Lamborghini
]===]) + if nr == "2" then return end + connection:send([===[
Maserati
]===]) + if nr == "3" then return end + connection:send([===[
Porsche
]===]) + if nr == "4" then return end + connection:send([===[
Bugatti
]===]) + if nr == "5" then return end + connection:send([===[
Mercedes
]===]) + end + + + dofile("httpserver-header.lc")(connection, 200, 'html') + connection:send([===[ + + + + + 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. Select the number of cars you want to see below.
+ Whoever manages to modify nodemcu-httpserver to load all four images without crashing wins a prize! +

+

+ choose: show one car + show two cars + show three cars + show four cars + show five cars + show six cars +

+ ]===]) + + showCars(args.n) + + connection:send([===[ + + + ]===]) +end + diff --git a/http/index.html b/http/index.html index 27ab9fd..8caf47a 100644 --- a/http/index.html +++ b/http/index.html @@ -22,6 +22,7 @@
  • Index: This page (static)
  • A text file: Simple text, to verify MIME type is ok. (static)
  • Nice cars: Stress test, loads several "large" images. Makes the chip panic and restart :( (static)
  • +
  • Nice cars: Stress test, loads several "large" images. Makes the chip panic and restart :( (dynamic to change number of cars)
  • Count Requests: Stress test, loads the same page over and over, counting every load. (static)
  • Zipped: File is actually saved as zipped.html.gz. A compressed file! (static but gzipped)
  • Zipped: Same exact file as served above. Server is smart enough to treat the .gz extension correctly (static but gzipped)