mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-07 20:52:05 +02:00
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:
+1
-3
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user