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::black_magic::get_parameter_tag(CROW_STATIC_ENDPOINT)>(CROW_STATIC_ENDPOINT)([static_dir_](cr

相关推荐

  1. SpringBoot 静态资源映射

    2024-01-19 02:32:01       65 阅读
  2. nginx配置缓存静态资源

    2024-01-19 02:32:01       44 阅读
  3. SpringMVC之静态资源访问

    2024-01-19 02:32:01       37 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-19 02:32:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-19 02:32:01       101 阅读
  3. 在Django里面运行非项目文件

    2024-01-19 02:32:01       82 阅读
  4. Python语言-面向对象

    2024-01-19 02:32:01       91 阅读

热门阅读

  1. 安卓、ios系统详解

    2024-01-19 02:32:01       55 阅读
  2. nginx配置https( Windows Server)

    2024-01-19 02:32:01       60 阅读
  3. Docker

    Docker

    2024-01-19 02:32:01      53 阅读
  4. 数据库系统概论-00引言

    2024-01-19 02:32:01       55 阅读
  5. 怎么检测香港服务器的速度?

    2024-01-19 02:32:01       48 阅读
  6. spring retry 配置及使用

    2024-01-19 02:32:01       52 阅读