"examples/vscode:/vscode.git/clone" did not exist on "157c9011d87e52632113024c1dc5125426971556"
Unverified Commit d7f09642 authored by Chenlei Hu's avatar Chenlei Hu Committed by GitHub
Browse files

Fix routes (#3790)

parent 028a583b
......@@ -538,8 +538,10 @@ class PromptServer():
# 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)
......
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