forked from ml87124909/Small
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.py
64 lines (41 loc) · 1.32 KB
/
start.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
61
# -*- coding: utf-8 -*-
##############################################################################
# Copyright (c) wxmall.janedao.cn
# Author:QQ173782910
#QQ group:528289471
##############################################################################
"""start.py"""
import os
import sys
from imp import reload
from flask import Flask, request
from flask_cors import CORS
reload(sys)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
sys.stdout = sys.stderr
from basic import publicw
reload(publicw)
ROOT = publicw.ROOT
showupload, showapi,showadmin,showWxPay = publicw.showupload,publicw.showapi,publicw.showadmin,publicw.showWxPay
sys.path.append(ROOT)
app=Flask(__name__)
app.config.from_object(__name__)
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RTYj'
CORS(app)
@app.route('/', methods=['GET', 'POST'])
@app.route('/admin' , methods=['GET', 'POST'])
def admin():
return showadmin(request)
@app.route('/api/<int:subid>', methods=['GET','POST'])
def api(subid):
return showapi(request,subid)
@app.route('/pay/<int:subid>/notify', methods=['GET','POST'])
def pay(subid):
return showWxPay(request,subid)
@app.route('/upload' , methods=['GET', 'POST'])
def upload():
return showupload(request)
if __name__ == '__main__':
app.run(host='127.0.0.1', port=5000)
application=app