diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index cb9be6a29..ded51c771 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -65,6 +65,10 @@ else () target_compile_options(example_chat PRIVATE "${compiler_options}") target_link_libraries(example_chat PUBLIC ${REQUIRED_LIBRARIES}) + add_executable(example_static_file example_static_file.cpp) + target_compile_options(example_static_file PRIVATE "${compiler_options}") + target_link_libraries(example_static_file PUBLIC ${REQUIRED_LIBRARIES}) + add_executable(example_catchall example_catchall.cpp) target_compile_options(example_catchall PRIVATE "${compiler_options}") target_link_libraries(example_catchall PUBLIC ${REQUIRED_LIBRARIES}) diff --git a/examples/example_static_file.cpp b/examples/example_static_file.cpp index 2744fc1a1..908f9e27f 100644 --- a/examples/example_static_file.cpp +++ b/examples/example_static_file.cpp @@ -1,5 +1,6 @@ //#define CROW_STATIC_DRIECTORY "alternative_directory/" //#define CROW_STATIC_ENDPOINT "/alternative_endpoint/" +//#define CROW_DISABLE_STATIC_DIR #define CROW_MAIN #include "crow.h" diff --git a/include/crow/app.h b/include/crow/app.h index 1c9f03e7a..f50ec4dde 100644 --- a/include/crow/app.h +++ b/include/crow/app.h @@ -212,8 +212,8 @@ namespace crow res.set_static_file_info(CROW_STATIC_DIRECTORY + file_path_partial); res.end(); }); - validate(); #endif + validate(); #ifdef CROW_ENABLE_SSL if (use_ssl_)