Skip to content
GitLab
菜单
为什么选择 GitLab
定价
联系销售
探索
为什么选择 GitLab
定价
联系销售
探索
登录
获取免费试用
主导航
搜索或转到…
项目
C
ComfyUI
管理
动态
成员
代码
仓库
分支
提交
标签
仓库图
比较修订版本
锁定的文件
部署
模型注册表
分析
模型实验
帮助
帮助
支持
GitLab 文档
比较 GitLab 各版本
社区论坛
为极狐GitLab 提交贡献
提交反馈
隐私声明
快捷键
?
新增功能
4
代码片段
群组
项目
显示更多面包屑
hanamizuki
ComfyUI
提交
97ae6ef4
未验证
提交
97ae6ef4
编辑于
9 months ago
作者:
Chenlei Hu
提交者:
GitHub
9 months ago
浏览文件
操作
下载
补丁
差异文件
Add api/ prefix to api endpoints (#3779)
上级
3914d5a2
No related branches found
分支 包含提交
No related tags found
标签 包含提交
无相关合并请求
变更
1
隐藏空白变更内容
行内
左右并排
显示
1 个更改的文件
server.py
+12
-1
12 个添加, 1 个删除
server.py
有
12 个添加
和
1 个删除
server.py
+
12
−
1
浏览文件 @
97ae6ef4
...
...
@@ -527,9 +527,20 @@ class PromptServer():
self
.
prompt_queue
.
delete_history_item
(
id_to_delete
)
return
web
.
Response
(
status
=
200
)
def
add_routes
(
self
):
self
.
user_manager
.
add_routes
(
self
.
routes
)
# Prefix every route with /api for easier matching for delegation.
# This is very useful for frontend dev server, which need to forward
# everything except serving of static files.
# Currently both the old endpoints without prefix and new endpoints with
# prefix are supported.
api_routes
=
web
.
RouteTableDef
()
for
route
in
self
.
routes
:
assert
isinstance
(
route
,
web
.
RouteDef
)
api_routes
.
route
(
route
.
method
,
"
/api
"
+
route
.
path
)(
route
.
handler
,
**
route
.
kwargs
)
self
.
app
.
add_routes
(
api_routes
)
self
.
app
.
add_routes
(
self
.
routes
)
for
name
,
dir
in
nodes
.
EXTENSION_WEB_DIRS
.
items
():
...
...
此差异已折叠。
点击以展开。
预览
0%
加载中
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
保存评论
取消
想要评论请
注册
或
登录