Construct web_server assets at build time instead of run time (#4944)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2023-06-18 20:51:19 -05:00
committed by Jesse Hills
parent 76e947651d
commit 959e7745a6
4 changed files with 100 additions and 45 deletions
@@ -83,6 +83,7 @@ class WebServerBase : public Component {
return;
}
this->server_ = std::make_shared<AsyncWebServer>(this->port_);
// All content is controlled and created by user - so allowing all origins is fine here.
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", "*");
this->server_->begin();