Skip to content

Commit fea5794

Browse files
committed
added support for routes that use '/' has the base tag
1 parent af285b0 commit fea5794

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

osbot_fast_api/api/routes/Fast_API__Routes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ def routes_paths(self):
327327

328328
def setup(self):
329329
self.setup_routes()
330-
self.app.include_router(self.router, prefix=self.prefix, tags=[self.tag])
330+
if self.prefix == '/': # handle scenario when we want to add routes directly to the root of the path
331+
self.app.include_router(self.router, tags=[self.tag])
332+
else:
333+
self.app.include_router(self.router, prefix=self.prefix, tags=[self.tag])
331334
return self
332335

333336
def setup_routes(self): # overwrite this to add routes to self.router

0 commit comments

Comments
 (0)