Skip to content

Commit

Permalink
refactor: rename handlers in CLI serve cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
newgene committed Jun 17, 2023
1 parent e6ab528 commit c123b38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions biothings/cli/web_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async def get(self):
self.write(to_json(list_routes + detail_routes))


class EntryHandler(BaseHandler):
class DocHandler(BaseHandler):
async def get(self, slug, item_id):
src_cols = self.application.db[slug]
doc = src_cols.find_one({"_id": item_id})
Expand All @@ -50,7 +50,7 @@ async def get(self, slug, item_id):
self.write(to_json(doc))


class EntriesHandler(BaseHandler):
class QueryHandler(BaseHandler):
async def get(self, slug):
src_cols = self.application.db[slug]

Expand Down Expand Up @@ -126,8 +126,8 @@ def __init__(self, db, table_space, **settings):
self.table_space = table_space
handlers = [
(r"/?", HomeHandler),
(r"/([^/]+)/?", EntriesHandler),
(r"/([^/]+)/([^/]+)/?", EntryHandler),
(r"/([^/]+)/?", QueryHandler),
(r"/([^/]+)/([^/]+)/?", DocHandler),
]
settings.update({"debug": True})
super().__init__(handlers, **settings)
Expand Down

0 comments on commit c123b38

Please sign in to comment.