Pass crow app to RestAPI

In order to properly stop the REST api you need to have
a handle to the app object.
This commit is contained in:
2019-03-29 16:18:01 +01:00
parent 74007b007b
commit bea27191c5
2 changed files with 3 additions and 5 deletions
+1 -3
View File
@@ -6,15 +6,13 @@
using namespace std;
void RestApi::start_rest_api(WriterManager& writer_manager, uint16_t port)
void RestApi::start_rest_api(crow::SimpleApp app, WriterManager& writer_manager, uint16_t port)
{
#ifdef DEBUG_OUTPUT
cout << "[rest_interface::start_rest_api] Starting rest interface on port " << port << endl;
#endif
crow::SimpleApp app;
CROW_ROUTE(app, "/kill")([&](){
writer_manager.kill();
+2 -2
View File
@@ -7,7 +7,7 @@
namespace RestApi
{
void start_rest_api(WriterManager& writer_manager, uint16_t port);
void start_rest_api(crow::SimpleApp app, WriterManager& writer_manager, uint16_t port);
}
#endif
#endif