-
Notifications
You must be signed in to change notification settings - Fork 78
/
main.py
41 lines (34 loc) · 1.44 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import webapp2
from base import export_timestamp, StaticHandler
from doc import DocumentRegisterHandler, DocumentUploadHandler, \
LatestDocumentsHandler, DocumentGetHandler, DocumentPaymentHandler, \
DocumentCheckHandler
from admin import PendingHandler, AutopayHandler, BootstrapHandler, \
PaymentCallback
from api import ExternalRegisterHandler, ExternalStatusHandler
from secrets import SECRET_ADMIN_PATH
from cron import ConfirmationCron, ConsolidationCron, PaymentCheckerCron
app = webapp2.WSGIApplication([
# static files
('/((?!api).)*', StaticHandler),
# internal API
('/api/document/register', DocumentRegisterHandler),
('/api/document/upload', DocumentUploadHandler),
('/api/document/latest', LatestDocumentsHandler),
('/api/document/get', DocumentGetHandler),
('/api/document/payment', DocumentPaymentHandler),
('/api/document/check', DocumentCheckHandler),
# manual admin
(SECRET_ADMIN_PATH + '/pending', PendingHandler),
(SECRET_ADMIN_PATH + '/autopay', AutopayHandler),
(SECRET_ADMIN_PATH + '/bootstrap', BootstrapHandler),
# callbacks for blockchain.info
('/api/callback', PaymentCallback),
# public API
('/api/v1/register', ExternalRegisterHandler),
('/api/v1/status', ExternalStatusHandler),
# cron
('/api/tasks/confirmation', ConfirmationCron),
('/api/tasks/payment_checker', PaymentCheckerCron),
('/api/tasks/consolidation', ConsolidationCron)
], debug=True)