Skip to content

Commit

Permalink
Fix routes (comfyanonymous#3790)
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei authored Jun 20, 2024
1 parent 028a583 commit d7f0964
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,10 @@ def add_routes(self):
# 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)
# 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)
self.app.add_routes(api_routes)
self.app.add_routes(self.routes)

Expand Down

0 comments on commit d7f0964

Please sign in to comment.