HttpServerStaticContentConfig

用于为静态文件服务进行高级配置的接口。

HttpServerRoute.staticFiles 的配置块中使用。

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun exclude(block: (ScriptFile) -> Boolean)

设置一个排除规则,用于防止某些文件被提供服务。

Link copied to clipboard
abstract fun getContext(): ScriptContext

获取脚本上下文对象 ScriptContext.

Link copied to clipboard
abstract fun setDefaultPath(path: String)

设置一个默认文件。当请求的路径不存在时,服务器将尝试提供这个文件作为响应。