2021-07-05 09:14:31 +00:00
|
|
|
#define CROW_MAIN
|
|
|
|
#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
|
|
|
|
|
|
|
CROW_BP_ROUTE(app, bp, "/")
|
|
|
|
([]() {
|
|
|
|
return "Hello world!";
|
|
|
|
});
|
|
|
|
|
2021-07-07 12:51:04 +00:00
|
|
|
CROW_BP_ROUTE(app, bp, "/templatt")
|
|
|
|
([]() {
|
|
|
|
crow::mustache::context ctxdat;
|
|
|
|
ctxdat["messg"] = "fifty five!!";
|
|
|
|
|
|
|
|
auto page = crow::mustache::load("indks.html");
|
|
|
|
|
|
|
|
return page.render(ctxdat);
|
|
|
|
});
|
|
|
|
|
2021-07-05 09:14:31 +00:00
|
|
|
app.register_blueprint(bp);
|
|
|
|
|
|
|
|
app.port(18080).run();
|
|
|
|
}
|