Archived
更新一些细节
This commit is contained in:
6 files changed
+44
-31
No files matched your search
+8
-2
@@ -15,8 +15,6 @@ from .main import main
|
|||||||
class Config:
|
class Config:
|
||||||
JSON_SORT_KEYS = False
|
JSON_SORT_KEYS = False
|
||||||
JSON_AS_ASCII = False
|
JSON_AS_ASCII = False
|
||||||
SQLALCHEMY_DATABASE_URI = './app/db/data.db'
|
|
||||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def init_app(app):
|
def init_app(app):
|
||||||
@@ -61,3 +59,11 @@ if __name__ == '__main__':
|
|||||||
print('数据库文件未找到, 正在下载中')
|
print('数据库文件未找到, 正在下载中')
|
||||||
download()
|
download()
|
||||||
print('下载完成')
|
print('下载完成')
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
'db',
|
||||||
|
'main',
|
||||||
|
'tests',
|
||||||
|
'utils',
|
||||||
|
'create_app'
|
||||||
|
]
|
||||||
@@ -4,3 +4,6 @@
|
|||||||
# @Development Tool: PyCharm
|
# @Development Tool: PyCharm
|
||||||
# @Create Time: 2022/3/25
|
# @Create Time: 2022/3/25
|
||||||
# @File Name: __init__.py.py
|
# @File Name: __init__.py.py
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ['db']
|
||||||
@@ -26,4 +26,3 @@ def internal_server_error(e):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
return {'code': 500, 'msg': '服务器内部错误', 'data': []}, 500
|
return {'code': 500, 'msg': '服务器内部错误', 'data': []}, 500
|
||||||
|
|
||||||
+18
-17
@@ -2,11 +2,8 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>Request Counter - Index</title>
|
<title>Request Counter | {{ remote_address }}</title>
|
||||||
<!-- 设置图标 -->
|
<link href="{{ url_for('static', filename='favicon.ico') }}" rel="shortcut icon">
|
||||||
<link rel="icon" type="image/png" sizes="128x128" href="{{ url_for('static', filename='favicon.ico') }}"/>
|
|
||||||
<link rel="apple-touch-icon" type="image/png" sizes="128x128"
|
|
||||||
href="{{ url_for('static', filename='favicon.ico') }}"/>
|
|
||||||
<style>
|
<style>
|
||||||
.intro{
|
.intro{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -18,28 +15,32 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="intro">
|
<div class="intro">
|
||||||
<br>
|
<div class="normal-text">
|
||||||
<br>
|
|
||||||
<i>看到这句话就说明程序正常运行啦!! <a href="https://markusjoe.github.io/RequestCounter/" target="_blank">查看文档</a></i>
|
<i>看到这句话就说明程序正常运行啦!! <a href="https://markusjoe.github.io/RequestCounter/" target="_blank">查看文档</a></i>
|
||||||
<br>
|
</div>
|
||||||
|
<div class="normal-text">
|
||||||
<i>服务端使用Flask开发没有使用异步编程</i>
|
<i>服务端使用Flask开发没有使用异步编程</i>
|
||||||
<br>
|
</div>
|
||||||
<i><a href="http://127.0.0.1:5000/api/v1/main">点击查看本地部署示例</a></i>
|
<div class="normal-text">
|
||||||
<br>
|
<i><a href="/api/v1/test-example">快速查看当前示例试用例</a></i>
|
||||||
<i><a href="https://requestcounter.herokuapp.com/count/RequestCounter">点击查看已部署好的调用示例</a></i>
|
</div>
|
||||||
<br>
|
<div class="normal-text">
|
||||||
|
<i><a href="https://requestcounter.herokuapp.com/count/test-example">点击查看已部署好的调用示例</a></i>
|
||||||
|
</div>
|
||||||
|
<div class="normal-text">
|
||||||
<i><b>注: 调用支持POST 和 GET 方法请求</b></i>
|
<i><b>注: 调用支持POST 和 GET 方法请求</b></i>
|
||||||
<br>
|
</div>
|
||||||
<br>
|
<div class="open_source_protocol">
|
||||||
<i>项目开源协议: <b>Apache-2.0</b> 即:
|
<i>项目开源协议: <b>Apache-2.0</b> 即:
|
||||||
<br>
|
<br>
|
||||||
你可以直接使用该项目提供的功能, 无需任何授权
|
你可以直接使用该项目提供的功能, 无需任何授权
|
||||||
<br>
|
<br>
|
||||||
你可以在注明来源版权信息的情况下对源代码进行任意分发和修改以及衍生
|
你可以在注明来源版权信息的情况下对源代码进行任意分发和修改以及衍生
|
||||||
</i>
|
</i>
|
||||||
<br>
|
</div>
|
||||||
<!-- 显示客户端的IP地址 -->
|
<div class="ip_address">
|
||||||
<i><b>你的IP地址为: {{ remote_address }}</b></i>
|
<i><b>你的IP地址为: {{ remote_address }}</b></i>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -4,3 +4,6 @@
|
|||||||
# @Development Tool: PyCharm
|
# @Development Tool: PyCharm
|
||||||
# @Create Time: 2022/3/26
|
# @Create Time: 2022/3/26
|
||||||
# @File Name: __init__.py.py
|
# @File Name: __init__.py.py
|
||||||
|
|
||||||
|
|
||||||
|
print('Tests models were loaded.')
|
||||||
@@ -6,12 +6,13 @@
|
|||||||
# @File Name: manage.py
|
# @File Name: manage.py
|
||||||
|
|
||||||
|
|
||||||
from gevent import pywsgi
|
|
||||||
from app import create_app
|
from app import create_app
|
||||||
|
|
||||||
app = create_app('default')
|
app = create_app('default')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
from gevent import pywsgi
|
||||||
|
|
||||||
print('服务运行在 http://127.0.0.1:5000')
|
print('服务运行在 http://127.0.0.1:5000')
|
||||||
try:
|
try:
|
||||||
server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
|
server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
|
||||||
|
|||||||
Reference in New Issue
Block a user