23 lines
646 B
Python
23 lines
646 B
Python
from flask import Flask
|
|
from .views.routes import main_bp
|
|
from .sockets.terminal_service import terminal_bp
|
|
from .views.file import file_bp
|
|
from .config import Config
|
|
from .extensions import init_extensions
|
|
|
|
def create_app():
|
|
app = Flask(__name__, template_folder="../templates", static_folder="../static",static_url_path="/vsc-like/static")
|
|
app.config.from_object(Config)
|
|
@app.route('/')
|
|
def hello():
|
|
return 'Hello, World!'
|
|
|
|
# 注册蓝图
|
|
app.register_blueprint(main_bp)
|
|
app.register_blueprint(terminal_bp)
|
|
app.register_blueprint(file_bp)
|
|
# 初始化SocketIO
|
|
init_extensions(app)
|
|
|
|
return app
|