Files

40 lines
1.1 KiB
C++
Raw Permalink Normal View History

2022-06-30 01:35:02 +02:00
#include <QLoggingCategory>
2022-06-30 02:08:09 +02:00
// esp-idf includes
2022-06-30 01:35:02 +02:00
#include <esp_log.h>
2022-06-30 02:08:09 +02:00
#include <asio.hpp>
// 3rdparty lib includes
#include <cppmacros.h>
2022-06-30 01:35:02 +02:00
2022-06-30 02:08:09 +02:00
// local includes
2022-06-30 01:35:02 +02:00
#include "examplewebserver.h"
2022-06-30 02:08:09 +02:00
namespace {
constexpr const char * const TAG = "ASIO_WEBSERVER";
} // namespace
2022-06-30 01:35:02 +02:00
int main(int argc, char *argv[])
{
2022-06-30 02:08:09 +02:00
CPP_UNUSED(argc)
CPP_UNUSED(argv)
2022-06-30 01:35:02 +02:00
qSetMessagePattern(QStringLiteral("%{time dd.MM.yyyy HH:mm:ss.zzz} "
"["
"%{if-debug}D%{endif}"
"%{if-info}I%{endif}"
"%{if-warning}W%{endif}"
"%{if-critical}C%{endif}"
"%{if-fatal}F%{endif}"
"] "
"%{function}(): "
"%{message}"));
asio::io_context io_context;
2022-06-30 02:08:09 +02:00
ExampleWebserver server{io_context, (unsigned short)8080};
2022-06-30 01:35:02 +02:00
2022-06-30 02:08:09 +02:00
ESP_LOGI(TAG, "running mainloop");
2022-06-30 01:35:02 +02:00
io_context.run();
}