默认的public静态目录是否可以多个?

楚羽幽

问题描述

https://www.workerman.net/doc/webman/static.html
根据文档中的说法是,public是默认静态目录
能不能增加除开public其他目录也为静态目录,同时兼容public也是静态目录呢?

640 1 1
1个回答

walkor

意思是请求文件时先从默认public目录找,找不到再从其它指定的public目录找?
webman本身不支持这种用法,不过你可以设置一个404处理
config/route.php 里设置

Route::fallback(function($request){
    $path = $request->path();
    return response()->file(other_public($path));
});

other_public函数需要你自己定义。

  • 暂无评论
年代过于久远,无法发表回答
🔝