-
Notifications
You must be signed in to change notification settings - Fork 0
/
web.py
19 lines (16 loc) · 635 Bytes
/
web.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from controller.HomeController import HomeController
from controller.AdminsController import AdminsController
'''
Notes: when you using routes
============================
1. The return type must be a string, dict, tuple, Response instance, or WSGI callable.
2. The function should either returned None or ended without a return statement.
3. The route functions should have different names. like (def route1():, def route2():).
'''
def routes(app):
@app.route('/', methods=['GET'])
def route1():
return HomeController.index()
@app.route('/admins', methods=['GET', 'POST'])
def route2():
return AdminsController.index()