Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sitinut Waisara committed Mar 26, 2020
2 parents bc0ad14 + 0e9aec1 commit 9632105
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Node main module/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,14 @@ void handle_getSensorJSON()
server.send(200, "application/json", currentJSONReply);
}

// handle redirect to home
void handle_redirect()
{
// redirect back to main page
server.sendHeader("Location", "/_ac", true);
server.send(302, "text/plain", "");
}

// handle 404
void handle_NotFound()
{
Expand Down Expand Up @@ -606,6 +614,7 @@ void setup()
loadSettings();

// attach handlers for HTTPserver
server.on("/", handle_redirect);
server.on("/save_settings", handle_SaveSettings);
server.on("/getJSON", handle_getSensorJSON);

Expand Down

0 comments on commit 9632105

Please sign in to comment.