-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
27 lines (20 loc) · 920 Bytes
/
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
from flask import Flask
from flask_restful import Api
from db import db
import os
from resources.timetable_res import TimeTableRes
from resources.work_res import WorkRes, WorkDocRes
from resources.notice_res import NoticeRes, NoticeDocRes
app = Flask(__name__)
api = Api(app)
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL', 'sqlite:///data.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.secret_key = 'farCry'
api.add_resource(TimeTableRes, '/timetable/<string:college>/<string:branch>/<string:std>/<string:div>')
api.add_resource(WorkRes, '/work/<string:college>/<string:branch>/<string:std>/<string:div>')
api.add_resource(WorkDocRes, '/work/<doc_id>')
api.add_resource(NoticeRes, '/notice/<string:college>/<string:branch>/<string:std>/<string:div>')
api.add_resource(NoticeDocRes, '/notice/<doc_id>')
if __name__ == '__main__':
db.init_app(app)
app.run(debug=True)