feat: implement MoloApp plans 01-15 with integration
Full C++23 framework tree: runtime, observability, security, data, app, realtime, supervisor, clients, CLI, example plus enterprise tenancy, audit, operability, governance, supplychain. Postgres via docker compose for tests.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
// Living example server entry: serves the demo app on loopback.
|
||||
// Usage: living-server [port] (default 8080)
|
||||
|
||||
#include <chrono>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
|
||||
#include "app/App.hpp"
|
||||
#include "fw/Server.hpp"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int port = 8080;
|
||||
if (argc > 1) {
|
||||
try {
|
||||
port = std::stoi(argv[1]);
|
||||
} catch (...) {
|
||||
std::cerr << "bad port\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
molo::example::app::Services services;
|
||||
auto app = molo::example::app::build_application(services);
|
||||
molo::example::fw::Server server(app);
|
||||
if (!server.start("127.0.0.1", port)) {
|
||||
std::cerr << "bind failed\n";
|
||||
return 1;
|
||||
}
|
||||
std::cout << "living example on http://127.0.0.1:" << server.port() << "\n";
|
||||
std::cout << "press Ctrl-C to stop\n";
|
||||
while (server.running()) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user