mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
f779a0f8a4
the macro is similar to CROW_ROUTE, added example to cmake, added unit test, and documentation
21 lines
422 B
C++
21 lines
422 B
C++
#define CROW_MAIN
|
|
#include <crow.h>
|
|
|
|
|
|
|
|
int main()
|
|
{
|
|
crow::SimpleApp app;
|
|
|
|
CROW_ROUTE(app, "/")([](){return "Hello";});
|
|
|
|
//Setting a custom route for any URL that isn't defined, instead of a simple 404.
|
|
CROW_CATCHALL_ROUTE(app)
|
|
([](crow::response& res) {
|
|
res.body = "The URL does not seem to be correct.";
|
|
res.end();
|
|
});
|
|
|
|
app.port(18080).run();
|
|
}
|