CxWebApp/src/main.cpp
CxAI Agent 055e350108
Some checks are pending
build-and-push / image (push) Waiting to run
feat: initial CxWebApp (macOS shell + swift-app wired to CxLLM-SDK)
2026-05-16 14:32:01 -05:00

32 lines
757 B
C++

#include "crow.h"
#include "routes.h"
#include <cstdlib>
#include <stdexcept>
#include <string>
int main() {
crow::SimpleApp app;
// Serve static files from ./static
// Crow serves them at /static/<path>
// Register route groups
routes::register_pages(app);
routes::register_api(app);
routes::register_system(app);
routes::register_proxy(app);
routes::register_mac(app);
// Start server (port overridable via CXWEBAPP_PORT)
int port = 8080;
if (const char* p = std::getenv("CXWEBAPP_PORT")) {
try { port = std::stoi(p); } catch (...) {}
}
CROW_LOG_INFO << "CxWebApp listening on :" << port;
app.port(static_cast<uint16_t>(port))
.multithreaded()
.run();
return 0;
}