HttpServerConfig

HTTP 服务器的主配置接口。

在调用 HttpServers.startServer 时,你会在此接口的 lambda 块中配置服务器的行为, 其中最重要的部分是定义路由规则。

Author

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

Functions

Link copied to clipboard
abstract fun getContext(): ScriptContext

获取脚本上下文对象 ScriptContext.

Link copied to clipboard
abstract fun routing(routingConfig: HttpServerRouting.() -> Unit): HttpServerRoutingRoot

定义服务器的路由。这是处理传入请求的核心。