File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,10 +94,11 @@ async def index(req: Request) -> Response:
9494
9595APP = web .Application ()
9696APP .router .add_post ("/api/messages" , messages )
97- APP .router .add_get ("/" , index )
9897
9998import os as _os
10099if _os .path .isdir ("web" ):
100+ APP .router .add_get ("/" , index )
101+ APP .router .add_get ("/index.html" , index )
101102 APP .router .add_static ("/" , "web" )
102103
103104if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1+ import asyncio
2+ import aiohttp
3+ from config import DefaultConfig
4+
5+ async def test_token ():
6+ config = DefaultConfig ()
7+ secret = config .WEB_CHAT_SECRET
8+ print (f"Secret: { secret } " )
9+
10+ async with aiohttp .ClientSession () as session :
11+ headers = {"Authorization" : f"Bearer { secret } " }
12+ async with session .get ("https://webchat.botframework.com/api/tokens" , headers = headers ) as resp :
13+ print (f"Status: { resp .status } " )
14+ text = await resp .text ()
15+ print (f"Token: { text } " )
16+
17+ if __name__ == "__main__" :
18+ asyncio .run (test_token ())
You can’t perform that action at this time.
0 commit comments