Skip to content

Commit d7f0964

Browse files
authored
Fix routes (Comfy-Org#3790)
1 parent 028a583 commit d7f0964

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

server.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,10 @@ def add_routes(self):
538538
# prefix are supported.
539539
api_routes = web.RouteTableDef()
540540
for route in self.routes:
541-
assert isinstance(route, web.RouteDef)
542-
api_routes.route(route.method, "/api" + route.path)(route.handler, **route.kwargs)
541+
# Custom nodes might add extra static routes. Only process non-static
542+
# routes to add /api prefix.
543+
if isinstance(route, web.RouteDef):
544+
api_routes.route(route.method, "/api" + route.path)(route.handler, **route.kwargs)
543545
self.app.add_routes(api_routes)
544546
self.app.add_routes(self.routes)
545547

0 commit comments

Comments
 (0)