From 2ae7254725072cd49a63160f9f40ef79e9d1cca9 Mon Sep 17 00:00:00 2001 From: Gulliver Date: Mon, 22 Jul 2024 22:38:50 +0200 Subject: [PATCH] set crow static directory and template directory in case of an empty static_dir or template dir parameter to blueprints url prefix as default. --- include/crow/routing.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/crow/routing.h b/include/crow/routing.h index 956fa49be..1110e589a 100644 --- a/include/crow/routing.h +++ b/include/crow/routing.h @@ -1095,7 +1095,7 @@ namespace crow // NOTE: Already documented in "crow/app.h" Node head_; }; - /// A blueprint can be considered a smaller section of a Crow app, specifically where the router is conecerned. + /// A blueprint can be considered a smaller section of a Crow app, specifically where the router is concerned. /// /// You can use blueprints to assign a common prefix to rules' prefix, set custom static and template folders, and set a custom catchall route. @@ -1103,8 +1103,11 @@ namespace crow // NOTE: Already documented in "crow/app.h" class Blueprint { public: - Blueprint(const std::string& prefix): - prefix_(prefix){}; + Blueprint(const std::string& prefix) + : prefix_(prefix), + static_dir_(prefix), + templates_dir_(prefix) + {}; Blueprint(const std::string& prefix, const std::string& static_dir): prefix_(prefix), static_dir_(static_dir){};