code-server-like
This commit is contained in:
22
code-server-like/app/__init__.py
Normal file
22
code-server-like/app/__init__.py
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
Reference in New Issue
Block a user