App
A Garvan app is the object that ties the HTTP server, the router, the logger and any registered middlewares together. You'll see one in every project.
SimpleApp
The most common choice is crow::SimpleApp. It has no middlewares attached at the application level — just routes.
crow::SimpleApp app;
CROW_ROUTE(app, "/")([] { return "ok"; });
app.port(9090).run();
App with middleware
When you need request-wide concerns (auth, sessions, CORS, etc.), reach for crow::App<M1, M2, ...>. The middlewares are composed left-to-right and unrolled at compile time.
struct AuthMW { struct context {}; void before_handle(...) {} void after_handle(...) {} };
crow::App<AuthMW> app;
Method chaining
The configuration methods are chainable, which keeps the entry point readable:
app.bindaddr("0.0.0.0")
.port(9090)
.multithreaded()
.run();
Running asynchronously
run() blocks the calling thread. If you need to keep doing other work, capture the handle returned by run_async() — let the variable fall out of scope and the server will shut down.
auto handle = app.port(9090).run_async();
// ... do other work ...
app.stop();