Description
Setting the CROW_DISABLE_STATIC_DIR define, e.g. via
target_compile_definitions(Crow INTERFACE CROW_DISABLE_STATIC_DIR) in the CMakeLists.txt, disables all blueprint paths.
Steps to reproduce the behavior:
Set the define CROW_DISABLE_STATIC_DIR
Compile the example_blueprint.cpp
Run it and try to access any blueprint route
To make the error more apparent
changing the line:
app.loglevel(crow::LogLevel::Debug).port(18080).run();
to
auto future = app.loglevel(crow::LogLevel::Debug).port(18080).run_async();
app.debug_print();
future.get();
clearly shows no routes at all.
(2024-11-11 22:54:53) [DEBUG ] Routing:
(2024-11-11 22:54:53) [INFO ] Crow/master server is running at http://0.0.0.0:18080 using 2 threads
(2024-11-11 22:54:53) [INFO ] Call `app.loglevel(crow::LogLevel::Warning)` to hide Info level logs.
(2024-11-11 22:54:53) [DEBUG ] 0000026706D1B590 {0} queue length: 1
Expected behavior
The non static blueprint routes should still be available.
Description Setting the CROW_DISABLE_STATIC_DIR define, e.g. via
target_compile_definitions(Crow INTERFACE CROW_DISABLE_STATIC_DIR)
in the CMakeLists.txt, disables all blueprint paths.Steps to reproduce the behavior:
example_blueprint.cpp
To make the error more apparent
changing the line:
app.loglevel(crow::LogLevel::Debug).port(18080).run();
toclearly shows no routes at all.
Expected behavior The non static blueprint routes should still be available.
Analysis
It looks like the code
in app.h is the only position where addblueprint() and within it `router.validate_bp();` gets called.
One possible fix would be to move
router_.validate_bp();
into the Crow::validate method.