Skip to content

Add html Webpage from data folder in SPIFF & run on APmode when HOME is pressed. #334

Answered by Hieromon
xtech007 asked this question in Q&A
Discussion options

You must be logged in to vote

A description of that technique is given in the documentation as Capture the legacy web pages as items into the menu.
The following sketch coded in the above section is a WebServer native page handler:

server.on("/hello", [](){
  server.send(200, "text/html", String(F(
"<html>"
"<head><meta name='viewport' content='width=device-width,initial-scale=1.0'></head>"
"<body><h2>Hello, world</h2></body>"
"</html>"
  )));
});

portal.append("/hello", "HELLO");

In that example, it is added as a "HELLO" item into the menu, but you can add a legacy page handler to the HOME menu item by using the AutoConnectConfig::homeUri setting.

So, what you need may be had in the sketch below:

#include <Arduino.h>
#

Replies: 6 comments 10 replies

Comment options

You must be logged in to vote
2 replies
@xtech007
Comment options

@xtech007
Comment options

Answer selected by Hieromon
Comment options

You must be logged in to vote
4 replies
@Hieromon
Comment options

@xtech007
Comment options

@Hieromon
Comment options

@xtech007
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Hieromon
Comment options

Comment options

You must be logged in to vote
3 replies
@xtech007
Comment options

@Hieromon
Comment options

@xtech007
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants