Skip to content

API ‐ 设置API

lifegpc edited this page Aug 25, 2023 · 2 revisions

设置接口

获取设置

GET /api/config

参数名字 参数类型 可选 描述
current boolean 是否返回服务器目前正在使用的设置,默认为false(0)
type "ws" | null 设置为"ws"来使用WebSocket通知客户端新的设置,默认为null,仅当currenttrue时生效

更新设置

POST /api/config

  • Content-Type 应设置为 application/json
  • 内容应为 Record<string, any>, 例如:
{ "cookie": "New Cookie", "hostname": "0.0.0.0" }
  • 返回示例
{"is_unsafe": false}

is_unsafetrue,则更新的设置中包含需要下次启动才能生效的设置。

Clone this wiki locally