-
Notifications
You must be signed in to change notification settings - Fork 2
/
fitbit_web_service.py
30 lines (21 loc) · 1.04 KB
/
fitbit_web_service.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
__author__ = 'pruthvi kumar'
"""
Author: Pruthvi Kumar BK
Email: [email protected]
Date: February 17, 2018
This is the entry point file for Gunicorn. This file contains all the routes to respectrive fitbit webservices.
"""
import falcon
from falcon_cors import CORS
from apiLayer.fitbitStore import FitbitWebServiceInit as defaultRoute
from apiLayer.fitbitStore import AuthorizeFitbitApi as authFitbit
from apiLayer.fitbitStore import FitbitAcknowledgeAuthorization as acknowledgeFitbitAuth
from apiLayer.fitbitStore import FitbitApiAnalytics as processFitbitApi
from apiLayer.fitbitStore import ValidateAuthorizationStatus as validateAuthStatus
cors = CORS(allow_all_origins=['http://localhost:8000']) #Allow CORS for this endpoint.
app = falcon.API(middleware=[cors.middleware,])
app.add_route('/', defaultRoute())
app.add_route('/authorizeFitbitApi', authFitbit())
app.add_route('/fitbitAuthCallback', acknowledgeFitbitAuth())
app.add_route('/validateFitbitAuthStatus', validateAuthStatus())
app.add_route('/processFitbitApi', processFitbitApi())