This repository has been archived on 2026-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
RequestCounter/manage.py
T

27 lines
671 B
Python
Raw Normal View History

2022-03-26 08:02:25 +08:00
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/3/25
# @File Name: manage.py
import os
2022-03-26 08:02:25 +08:00
from app import create_app
config = os.getenv('FLASK_CONFIG') or os.getenv('DYNO') or 'default'
app = create_app(config)
2022-03-26 09:12:12 +08:00
2022-03-26 08:02:25 +08:00
if __name__ == '__main__':
2022-04-02 18:03:25 +08:00
from gevent import pywsgi
app.logger.info('服务运行在 http://127.0.0.1:5000')
2022-03-26 08:41:15 +08:00
try:
server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
server.serve_forever()
except KeyboardInterrupt:
app.logger.info('已退出')
2022-03-26 08:41:15 +08:00
except OSError:
app.logger.critical('5000 端口已被占用')
2022-04-11 21:49:36 +08:00
exit(1)