Crow:CROW_STATIC_DIRECTORY静态资源

Crow通过宏定义CROW_STATIC_DIRECTORY来指定静态资源的目录。

CROW_STATIC_DIRECTORY默认被定义为"static/"

#ifndef CROW_STATIC_DIRECTORY
#define CROW_STATIC_DIRECTORY "static/"
#endif

 Crow:基于req.rul查找路由Rule对象及匹配参数-CSDN博客

Crow::run()会调用Crow::validate()

class Crow
{
public:
    void validate()
    {
        if (!validated_)
        {
            std::string static_dir_(CROW_STATIC_DIRECTORY);
            std::replace(static_dir_.begin(), static_dir_.end(), '\\', '/');
            if (static_dir_[static_dir_.length() - 1] != '/')
                static_dir_ += '/';

            route(CROW_STATIC_ENDPOINT)([static_dir_](cr

你可能感兴趣的:(Crow,c++)