Merge pull request #163 from CrowCpp/patch_static_folder

Patch Static Folder
This commit is contained in:
Farook Al-Sammarraie 2021-07-05 12:51:22 +03:00 committed by GitHub
commit 475e20b0e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -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})

View File

@ -1,5 +1,6 @@
//#define CROW_STATIC_DRIECTORY "alternative_directory/"
//#define CROW_STATIC_ENDPOINT "/alternative_endpoint/<path>"
//#define CROW_DISABLE_STATIC_DIR
#define CROW_MAIN
#include "crow.h"

View File

@ -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_)