forked from tushar-borole/HospitalManagementSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
35 lines (26 loc) · 939 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
28
29
30
31
32
33
34
35
#Tushar Borole
#Python 2.7
from flask import Flask,send_from_directory,render_template
from flask_restful import Resource, Api
from package.patient import Patients, Patient
from package.doctor import Doctors, Doctor
from package.appointment import Appointments, Appointment
from package.common import Common
import json
with open('config.json') as data_file:
config = json.load(data_file)
app = Flask(__name__, static_url_path='')
api = Api(app)
api.add_resource(Patients, '/patient')
api.add_resource(Patient, '/patient/<int:id>')
api.add_resource(Doctors, '/doctor')
api.add_resource(Doctor, '/doctor/<int:id>')
api.add_resource(Appointments, '/appointment')
api.add_resource(Appointment, '/appointment/<int:id>')
api.add_resource(Common, '/common')
# Routes
@app.route('/')
def index():
return app.send_static_file('index.html')
if __name__ == '__main__':
app.run(debug=True,host=config['host'],port=config['port'])