复现已有算法
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#include <drogon/drogon.h>
|
||||
#include <trantor/utils/Logger.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "controllers/WindPowerController.h"
|
||||
|
||||
using namespace drogon;
|
||||
|
||||
int main() {
|
||||
// 抑制 Drogon/trantor 内部日志噪声
|
||||
trantor::Logger::setLogLevel(trantor::Logger::kFatal);
|
||||
|
||||
// 加载 Drogon 配置(监听端口 / CORS / 静态资源根目录)
|
||||
LOG_INFO << "Loading server configuration...";
|
||||
app().loadConfigFile("config/server_config.json");
|
||||
app().registerController(std::make_shared<WindPowerController>());
|
||||
|
||||
// SPA 前端路由回退:未匹配路径统一返回 index.html,交由前端路由处理
|
||||
app().setCustom404Page(
|
||||
HttpResponse::newFileResponse("./web/index.html", "", CT_TEXT_HTML),
|
||||
false);
|
||||
|
||||
LOG_INFO << "wind_server starting...";
|
||||
|
||||
// 阻塞运行,直到收到 SIGINT/SIGTERM
|
||||
app().run();
|
||||
|
||||
LOG_INFO << "wind_server stopped";
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user