Skip to content

Commit

Permalink
Merge pull request #139 from gsarrco:staging
Browse files Browse the repository at this point in the history
Merge v0.5.4 into production
  • Loading branch information
gsarrco authored Oct 15, 2023
2 parents b814dbf + 781dc79 commit a0922f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions MuoVErsi/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,9 +605,21 @@ async def telegram(request: Request) -> Response:
Update.de_json(data=await request.json(), bot=application.bot)
)
return Response()

async def home(request: Request) -> Response:
sources = thismodule.sources
text_response = '<html><ul>'
for source in sources.values():
if hasattr(source, 'gtfs_version'):
text_response += f'<li>{source.name}: GTFS v.{source.gtfs_version}</li>'
else:
text_response += f'<li>{source.name}</li>'
text_response += '</ul></html>'
return Response(text_response)

starlette_app = Starlette(
routes=[
Route("/", home),
Route("/tg_bot_webhook", telegram, methods=["POST"])
]
)
Expand Down

0 comments on commit a0922f0

Please sign in to comment.