OdbDesign
OdbDesign ODB++ Parser - C++ library, gRPC/REST server, CLI, tests
 
Loading...
Searching...
No Matches
HelloWorldController.cpp
Go to the documentation of this file.
2#include "../OdbDesignServerApp.h"
3
4using namespace Odb::Lib::App;
5
6namespace Odb::App::Server
7{
12
14 {
15 // /helloworld
16 CROW_ROUTE(m_serverApp.crow_app(), "/helloworld")([]() {
17 //return "Hello world";
18 auto page = crow::mustache::load_text("helloworld.html");
19 return page;
20 });
21
22 // /hellodesign/<string>
23 CROW_ROUTE(m_serverApp.crow_app(), "/hellodesign/<string>")([](std::string designName) {
24 auto page = crow::mustache::load("helloworld.html");
25 crow::mustache::context ctx({ {"design", designName} });
26 return page.render(ctx);
27 });
28 }
29}
HelloWorldController(Odb::Lib::App::IOdbServerApp &serverApp)
virtual CrowApp & crow_app()=0