Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
97ae6ef4
Unverified
Commit
97ae6ef4
authored
Jun 19, 2024
by
Chenlei Hu
Committed by
GitHub
Jun 19, 2024
Browse files
Add api/ prefix to api endpoints (#3779)
parent
3914d5a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
server.py
server.py
+12
-1
No files found.
server.py
View file @
97ae6ef4
...
@@ -527,9 +527,20 @@ class PromptServer():
...
@@ -527,9 +527,20 @@ class PromptServer():
self
.
prompt_queue
.
delete_history_item
(
id_to_delete
)
self
.
prompt_queue
.
delete_history_item
(
id_to_delete
)
return
web
.
Response
(
status
=
200
)
return
web
.
Response
(
status
=
200
)
def
add_routes
(
self
):
def
add_routes
(
self
):
self
.
user_manager
.
add_routes
(
self
.
routes
)
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
)
self
.
app
.
add_routes
(
self
.
routes
)
for
name
,
dir
in
nodes
.
EXTENSION_WEB_DIRS
.
items
():
for
name
,
dir
in
nodes
.
EXTENSION_WEB_DIRS
.
items
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment