dev: 编写了测试路由,细化了项目结构
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
from flask import Flask
|
||||
|
||||
|
||||
def create_app(config_class='config.DevelopmentConfig'):
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(config_class)
|
||||
|
||||
# 注册蓝图
|
||||
from app.routes.pages import page_bp
|
||||
app.register_blueprint(page_bp)
|
||||
|
||||
return app
|
||||
@@ -0,0 +1,7 @@
|
||||
from flask import Blueprint, jsonify
|
||||
|
||||
page_bp = Blueprint("page", __name__, "/")
|
||||
|
||||
@page_bp.route("/")
|
||||
def index():
|
||||
return jsonify({"code": "200", "message": "Service normal"})
|
||||
Reference in New Issue
Block a user