Skip to content

Commit

Permalink
set crow static directory and template directory in case of an empty …
Browse files Browse the repository at this point in the history
…static_dir or template dir parameter to blueprints url prefix as default.
  • Loading branch information
gittiver committed Jul 27, 2024
1 parent cfd83fe commit 2ae7254
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/crow/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -1095,16 +1095,19 @@ 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.
/// You can also assign nest blueprints for maximum Compartmentalization.
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){};
Expand Down

0 comments on commit 2ae7254

Please sign in to comment.