.BANCHO. Add basic api code

This commit is contained in:
Nyo 2016-10-31 09:44:36 +01:00
parent 0e5471383e
commit 7699dd288c
5 changed files with 15 additions and 2 deletions

2
common

@ -1 +1 @@
Subproject commit 97ed79d4a1a721bec3ebfe05f11ffde589f97bd2
Subproject commit 4b713cbb2854744fcf6f9faabdf6311a35da5209

0
handlers/api/__init__.py Normal file
View File

7
handlers/api/ping.py Normal file
View File

@ -0,0 +1,7 @@
from common.web.api import api
class handler(api.asyncAPIHandler):
@api.api
@api.args("ses")
def asyncGet(self):
self.data["message"] = "狂乱 Hey Kids!!"

View File

@ -4,6 +4,7 @@ import time
from common.ddog import datadogClient
from common.files import fileBuffer, fileLocks
from common.web.api import rateLimit
from objects import channelList
from objects import matchList
from objects import streamList
@ -50,3 +51,4 @@ startTime = int(time.time())
streams = streamList.streamList()
rateLimits = rateLimit.rateLimiters(60, 60)

6
pep.py
View File

@ -25,6 +25,7 @@ from handlers import apiVerifiedStatusHandler
from handlers import ciTriggerHandler
from handlers import mainHandler
from handlers import heavyHandler
from handlers.api import ping
from helpers import configHelper
from helpers import consoleHelper
from helpers import systemHelper as system
@ -35,6 +36,7 @@ from objects import fokabot
from objects import glob
def make_app():
return tornado.web.Application([
(r"/", mainHandler.handler),
@ -44,7 +46,9 @@ def make_app():
(r"/api/v1/ciTrigger", ciTriggerHandler.handler),
(r"/api/v1/verifiedStatus", apiVerifiedStatusHandler.handler),
(r"/api/v1/fokabotMessage", apiFokabotMessageHandler.handler),
(r"/stress", heavyHandler.handler)
(r"/stress", heavyHandler.handler),
(r"/api/v2/ping", ping.handler),
])
if __name__ == "__main__":