<gh_stars>1-10
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@author: yuejl
@application:
@contact: <EMAIL>
@file: __init__.py.py
@time: 2021/7/5 0005 19:27
@desc:
'''
from flask import Flask
from config import Config


def create_app(config_class=Config):
    app = Flask(__name__)
    app.config.from_object(config_class)

    # 注册 blueprint
    from app.api import bp as api_bp
    app.register_blueprint(api_bp, url_prefix='/api')

    return app
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@author: yuejl
@application:
@contact: <EMAIL>
@file: __init__.py.py
@time: 2021/7/5 0005 19:27
@desc:
'''
from flask import Flask
from config import Config


def create_app(config_class=Config):
    app = Flask(__name__)
    app.config.from_object(config_class)

    # 注册 blueprint
    from app.api import bp as api_bp
    app.register_blueprint(api_bp, url_prefix='/api')

    return app
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- @author: yuejl @application: @contact: <EMAIL> @file: __init__.py.py @time: 2021/7/5 0005 19:27 @desc: # 注册 blueprint