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
1ef66b09
"deploy/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "cb7fabbe8e06bfe827d1418ccab26eedadc909f6"
Unverified
Commit
1ef66b09
authored
Jul 02, 2024
by
Bob Du
Committed by
GitHub
Jul 01, 2024
Browse files
Add example for how to add custom API routes (#3597)
parent
9dd549e2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
custom_nodes/example_node.py.example
custom_nodes/example_node.py.example
+10
-0
No files found.
custom_nodes/example_node.py.example
View file @
1ef66b09
...
@@ -106,6 +106,16 @@ class Example:
...
@@ -106,6 +106,16 @@ class Example:
# Set the web directory, any .js file in that directory will be loaded by the frontend as a frontend extension
# Set the web directory, any .js file in that directory will be loaded by the frontend as a frontend extension
# WEB_DIRECTORY = "./somejs"
# WEB_DIRECTORY = "./somejs"
# Add custom API routes, using router
from aiohttp import web
from server import PromptServer
@PromptServer.instance.routes.get("/hello")
async def get_hello(request):
return web.json_response("hello")
# A dictionary that contains all nodes you want to export with their names
# A dictionary that contains all nodes you want to export with their names
# NOTE: names should be globally unique
# NOTE: names should be globally unique
NODE_CLASS_MAPPINGS = {
NODE_CLASS_MAPPINGS = {
...
...
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