1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

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 GitHub
parent b9f20b36cb
commit cd57271386
4 changed files with 100 additions and 45 deletions

View File

@@ -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();