Skip to content

Commit

Permalink
Add API endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
GetPsyched committed Apr 3, 2022
1 parent 771fac0 commit 25eead6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions api/group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from aiohttp import web

group = web.Application()
routes = web.RouteTableDef()

@routes.post('/')
async def main(request):
return web.Response(text='Access all club/society endpoints through here!')

group.router.add_routes(routes)
17 changes: 17 additions & 0 deletions api/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from aiohttp import web

from api.group import group


app = web.Application()
routes = web.RouteTableDef()

app.add_subapp('/group', group)

@routes.post('/')
async def main(request):
return web.json_response({
'message': f"Logged in as {request.config_dict['bot'].user}",
})

app.router.add_routes(routes)

0 comments on commit 25eead6

Please sign in to comment.