私有静态文件应该在 public 文件夹之外吗?

Should private static files be outside of the public folder?

据我了解,public 文件夹包含大多数静态资产,例如我的 index.html 页面和视频。这些资产 public/accessible 给用户了吗?

我想知道我是否想保持视频的私密性和安全性(例如安全镜头),我是否应该将视频移动到其他文件夹而不是 express 提供静态文件的静态 public 文件夹,例如作为我的 index.html?

express.static() 指向的 public 文件夹将可供外界的任何人访问,因此您不应将任何不属于 public 的内容放在那里.出于这个原因,它通常被命名为“public” - 这些是 public 只能访问的资源。

观看前需要凭据的私人视频应保存在其他地方,并且只能通过在提供前验证适当凭据的路径访问。

From my understanding, public folder holds most static assets such as my index.html page and videos.

是的,大体上是正确的。

Are these assets public/accessible to users?

如果您在 express.static() 中间件之前没有任何授权检查或凭证检查,那么是的,这些资产可用于 public。