forked from gsetant/general-server-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (28 loc) · 945 Bytes
/
main.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
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# ***********************************
# 初始化自动安装 基本 环境支持包 ###别换地方
from app.tools.init_base_package import init_base_require
init_base_require()
import logging
from app.tools.config_tools import APP_CONFIG, get_config
from app.tools.init_tools import init_app
from app.tools.router_tools import register_blueprints
# init project install packages
init_app()
from flask import Flask
from flask_cors import *
app = Flask(__name__, static_folder='front-end/dist/', static_url_path='')
app_config = get_config(APP_CONFIG)
CORS(app, supports_credentials=True)
# register blueprints
register_blueprints(app, 'app.core.api', 'api')
# region start
if __name__ == "__main__":
app.debug = app_config['DEBUG']
app.run(
host=app_config['HOST'],
port=app_config['PORT'],
use_reloader=False
)
logging.basicConfig(level=logging.INFO)