Unverified Commit d7f09642 authored by Chenlei Hu's avatar Chenlei Hu Committed by GitHub
Browse files

Fix routes (#3790)

parent 028a583b
...@@ -538,7 +538,9 @@ class PromptServer(): ...@@ -538,7 +538,9 @@ class PromptServer():
# prefix are supported. # prefix are supported.
api_routes = web.RouteTableDef() api_routes = web.RouteTableDef()
for route in self.routes: for route in self.routes:
assert isinstance(route, web.RouteDef) # Custom nodes might add extra static routes. Only process non-static
# routes to add /api prefix.
if isinstance(route, web.RouteDef):
api_routes.route(route.method, "/api" + route.path)(route.handler, **route.kwargs) api_routes.route(route.method, "/api" + route.path)(route.handler, **route.kwargs)
self.app.add_routes(api_routes) self.app.add_routes(api_routes)
self.app.add_routes(self.routes) self.app.add_routes(self.routes)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment