@@ -21,8 +21,6 @@ It features
2121* Only files in the root folder are supported for simplicity - no directories.
2222
2323
24-
25-
2624## Implementing a web server
2725
2826The ESP8266WebServer library offers a simple path to implement a web server on a ESP8266 board.
@@ -90,7 +88,7 @@ that actually has only one line of functionality by sending a string as result t
9088> });
9189> ```
9290
93- Here the text from a static String with html code is returned instead of a file from the filesystem.
91+ Here the text from a static string with html code is returned instead of a file from the filesystem.
9492The content of this string can be found in the file `builtinfiles.h`. It contains a small html+javascript implementation
9593that allows uploading new files into the empty filesystem.
9694
@@ -100,14 +98,14 @@ Just open <http://webserver/$upload.htm> and drag some files from the data folde
10098## Registering a function to handle requests to the server without a path
10199
102100Often servers are addressed by using the base URL like <http://webserver/> where no further path details is given.
103- Of course we like the user to be redirected to something usable. Therefore the `handleRoot ()` function is registered:
101+ Of course we like the user to be redirected to something usable. Therefore the `handleRedirect ()` function is registered:
104102
105103> ```CPP
106- > server.on("/$upload.htm ", handleRoot );
104+ > server.on("/", HTTP_GET, handleRedirect );
107105> ```
108106
109- The `handleRoot ()` function checks the filesystem for the file named **/index.htm** and creates a redirect to this file when the file exists.
110- Otherwise the redirection goes to the built-in **/$upload.htm** web page.
107+ The `handleRedirect ()` function checks the filesystem for the file named **/index.htm** and creates a redirect
108+ response to this file when the file exists. Otherwise the redirection goes to the built-in **/$upload.htm** web page.
111109
112110
113111
0 commit comments