-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapi.py
More file actions
30 lines (22 loc) · 1.09 KB
/
api.py
File metadata and controls
30 lines (22 loc) · 1.09 KB
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
from flask_restful import Api
from resources.status import *
from resources.subscribers import *
from resources.past_prices import *
from resources.fresh_price import *
from resources.future_prices import *
from resources.mail_service import *
def create_api(app):
api = Api(app)
api.add_resource(ServerStatus, '/', '/ping')
api.add_resource(SubscriberList, '/subscribers')
api.add_resource(Subscriber, '/subscribers/<string:email>')
api.add_resource(SubscriberQty, '/subscribers-qty')
api.add_resource(PastPriceList, '/past-prices/<string:currency>')
api.add_resource(PastPriceByDate, '/past-prices/<string:currency>&<string:date>')
api.add_resource(FreshPrice, '/price/<string:currency>')
api.add_resource(FuturePriceList, '/future-prices/<string:currency>')
api.add_resource(FuturePrice, '/future-prices/<string:currency>&<string:date>')
api.add_resource(InstantMailService, '/mail/<string:recipient>')
api.add_resource(AuthMailService, '/auth/<string:recipient>')
api.add_resource(NewsletterService, '/newsletter/<string:recipient>')
return api