Files
DawnMagnet f0265447b5
CMake Build / build (push) Successful in 50s
initial commit
2025-03-21 23:50:06 +08:00

21 lines
397 B
C++

#include "crow_all.h"
int main() {
crow::SimpleApp app;
CROW_ROUTE(app, "/")([]() {
return "Hello world";
});
// POST request
CROW_ROUTE(app, "/json").methods("POST"_method)([](const crow::request &req) {
auto x = crow::json::load(req.body);
if (!x) {
return crow::response(400);
}
return crow::response(1);
});
app.port(18080).multithreaded().run();
}