Crow通过宏定义CROW_STATIC_DIRECTORY来指定静态资源的目录。
CROW_STATIC_DIRECTORY默认被定义为"static/"
#ifndef CROW_STATIC_DIRECTORY
#define CROW_STATIC_DIRECTORY "static/"
#endif
Crow:基于req.rul查找路由Rule对象及匹配参数-CSDN博客文章来源:https://www.toymoban.com/news/detail-810027.html
Crow::run()会调用Crow::validate()文章来源地址https://www.toymoban.com/news/detail-810027.html
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::black_magic::get_parameter_tag(CROW_STATIC_ENDPOINT)>(CROW_STATIC_ENDPOINT)([static_dir_](cr
到了这里,关于Crow:CROW_STATIC_DIRECTORY静态资源的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!