2021-07-05 09:14:31 +00:00
|
|
|
#include "crow.h"
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
crow::SimpleApp app;
|
|
|
|
|
2021-07-07 12:51:04 +00:00
|
|
|
crow::Blueprint bp("bp_prefix", "cstat", "ctemplate");
|
2021-07-05 09:14:31 +00:00
|
|
|
|
2021-07-27 07:52:49 +00:00
|
|
|
|
|
|
|
crow::Blueprint sub_bp("bp2", "csstat", "cstemplate");
|
|
|
|
|
|
|
|
CROW_BP_ROUTE(sub_bp, "/")
|
2021-07-05 09:14:31 +00:00
|
|
|
([]() {
|
|
|
|
return "Hello world!";
|
|
|
|
});
|
|
|
|
|
2021-07-30 10:09:01 +00:00
|
|
|
/* CROW_BP_ROUTE(bp, "/templatt")
|
2021-07-07 12:51:04 +00:00
|
|
|
([]() {
|
|
|
|
crow::mustache::context ctxdat;
|
|
|
|
ctxdat["messg"] = "fifty five!!";
|
|
|
|
|
|
|
|
auto page = crow::mustache::load("indks.html");
|
|
|
|
|
|
|
|
return page.render(ctxdat);
|
|
|
|
});
|
2021-07-30 10:09:01 +00:00
|
|
|
*/
|
2021-07-27 07:52:49 +00:00
|
|
|
CROW_BP_CATCHALL_ROUTE(sub_bp)([](){return "WRONG!!";});
|
|
|
|
|
|
|
|
|
|
|
|
bp.register_blueprint(sub_bp);
|
2021-07-05 09:14:31 +00:00
|
|
|
app.register_blueprint(bp);
|
|
|
|
|
2021-08-26 15:42:57 +00:00
|
|
|
app.loglevel(crow::LogLevel::Debug).port(18080).run();
|
2021-07-05 09:14:31 +00:00
|
|
|
}
|