-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.py
41 lines (34 loc) · 1.1 KB
/
server.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
# coding:utf-8
from flask import Flask, render_template, url_for, request, redirect, session, make_response, jsonify, abort
from flask import request
from flask import make_response,Response
from flask_cors import CORS
import urllib
import json
import re
import pymysql
import random
import time
import urllib.request
import hashlib
import configparser
import os
import traceback
version = EDITION
ip = "127.0.0.1" # IP
announcement = "全新的DPS统计已出炉,大家可以关注一下,看一下各门派的表现~"
app = Flask(__name__)
CORS(app)
app.config['JSON_AS_ASCII'] = False
def Response_headers(content):
resp = Response(content)
resp.headers['Access-Control-Allow-Origin'] = '*'
return resp
if __name__ == '__main__':
import signal
config = configparser.RawConfigParser()
config.read_file(open('./settings.cfg'))
app.dbname = config.get('jx3auction', 'username')
app.dbpwd = config.get('jx3auction', 'password')
app.debug = config.getboolean('jx3auction', 'debug')
app.run(host='0.0.0.0', port=8009, debug=app.debug, threaded=True)