8000 Implemented support for filters and removable routes in ESP8266WebServer by ayushsharma82 · Pull Request #9152 · esp8266/Arduino · GitHub
[go: up one dir, main page]

Skip to content

Implemented support for filters and removable routes in ESP8266WebServer #9152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jun 15, 2024
Prev Previous commit
Next Next commit
fix: formatting
  • Loading branch information
ayushsharma82 committed Jun 14, 2024
commit 9661ded5cd34f04fa7d767a0ba6714ece5153db2
20 changes: 10 additions & 10 deletions libraries/ESP8266WebServer/examples/Filters/Filters.ino
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ void setup(void) {

// This route will be accessible by STA clients only
server.on("/", [&]() {
digitalWrite(led, 1);
server.send(200, "text/plain", "Hi!, This route is accessible for STA clients only");
digitalWrite(led, 0);
})
.setFilter(ON_STA_FILTER);
digitalWrite(led, 1);
server.send(200, "text/plain", "Hi!, This route is accessible for STA clients only");
digitalWrite(led, 0);
})
.setFilter(ON_STA_FILTER);

// This route will be accessible by AP clients only
server.on("/", [&]() {
digitalWrite(led, 1);
server.send(200, "text/plain", "Hi!, This route is accessible for AP clients only");
digitalWrite(led, 0);
})
.setFilter(ON_AP_FILTER);
digitalWrite(led, 1);
server.send(200, "text/plain", "Hi!, This route is accessible for AP clients only");
digitalWrite(led, 0);
})
.setFilter(ON_AP_FILTER);

server.on("/inline", []() {
server.send(200, "text/plain", "this works as well");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public:
// Close the file
if (_fsUploadFile) { _fsUploadFile.close(); }
} // if
} // upload()
} // upload()

protected:
File _fsUploadFile;
Expand Down
Loading
0