Skip to content

Commit 7e47d4c

Browse files
committed
fixed issue where disabling crow static directory would also disable all other routes
1 parent 6a1623b commit 7e47d4c

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

examples/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ else ()
6565
target_compile_options(example_chat PRIVATE "${compiler_options}")
6666
target_link_libraries(example_chat PUBLIC ${REQUIRED_LIBRARIES})
6767

68+
add_executable(example_static_file example_static_file.cpp)
69+
target_compile_options(example_static_file PRIVATE "${compiler_options}")
70+
target_link_libraries(example_static_file PUBLIC ${REQUIRED_LIBRARIES})
71+
6872
add_executable(example_catchall example_catchall.cpp)
6973
target_compile_options(example_catchall PRIVATE "${compiler_options}")
7074
target_link_libraries(example_catchall PUBLIC ${REQUIRED_LIBRARIES})

examples/example_static_file.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//#define CROW_STATIC_DRIECTORY "alternative_directory/"
22
//#define CROW_STATIC_ENDPOINT "/alternative_endpoint/<path>"
3+
//#define CROW_DISABLE_STATIC_DIR
34
#define CROW_MAIN
45
#include "crow.h"
56

include/crow/app.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ namespace crow
212212
res.set_static_file_info(CROW_STATIC_DIRECTORY + file_path_partial);
213213
res.end();
214214
});
215-
validate();
216215
#endif
216+
validate();
217217

218218
#ifdef CROW_ENABLE_SSL
219219
if (use_ssl_)

0 commit comments

Comments
 (0)