-
Notifications
You must be signed in to change notification settings - Fork 12
/
app.py
60 lines (44 loc) · 1.92 KB
/
app.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from flask import Flask
from flask_restful import Api, Resource
from werkzeug.contrib.cache import SimpleCache
from resources.dining import Dining, DiningInformation, DiningSearch, DiningToday
#from resources.weather import Weather
from resources.wifi import Wifi, WifiNearMe
from resources.laundry import Laundry
from resources.main import Main
from resources.free_food import FreeFood
from resources.ews_status import EWSStatus
from resources.athletic_schedule import AthleticSchedule
from resources.buildings import Buildings
from resources.directory import FacultyDirectory
from resources.daily_illini import News, SubCategoryNews, SportsNews, RecentNews
from resources.calendar import Calendar
app = Flask(__name__)
api = Api(app)
cache = SimpleCache(app)
# Define routes
api.add_resource(Main, '/')
'''Dining'''
api.add_resource(DiningToday, '/dining/<string:hall>')
api.add_resource(Dining, '/dining/<string:hall>/<string:dateFrom>/<string:dateTo>')
api.add_resource(DiningSearch, '/dining/search/<string:query>')
api.add_resource(DiningInformation, '/dining/information')
'''Wifi'''
api.add_resource(Wifi, '/wifi')
#api.add_resource(WifiNearMe, '/wifi/<string:latitude>/<string:longitude>')
#api.add_resource(Weather, '/weather')
api.add_resource(Laundry, '/laundry')
api.add_resource(FacultyDirectory, '/directory/faculty')
'''News'''
api.add_resource(News, '/news/<string:category>')
api.add_resource(SubCategoryNews, '/news/<string:category>/<string:subcategory>')
api.add_resource(SportsNews, '/news/<string:category>/<string:subcategory>/<string:sportcategory>')
api.add_resource(RecentNews, '/news/recent')
api.add_resource(Buildings, '/buildings')
api.add_resource(AthleticSchedule, '/athleticschedule/<string:sport>')
#api.add(Maintenance, '', '')
api.add_resource(FreeFood, '/freefood')
api.add_resource(EWSStatus, '/ews-status')
api.add_resource(Calendar, '/calendar/<string:year>')
if __name__ == '__main__':
app.run(debug=True)