You've already forked my-video-workflow
初次提交
This commit is contained in:
29
controller/api/config_blueprint.py
Normal file
29
controller/api/config_blueprint.py
Normal file
@ -0,0 +1,29 @@
|
||||
from flask import Blueprint, jsonify, request
|
||||
|
||||
from config import get_config, write_config, load_config
|
||||
|
||||
blueprint = Blueprint("api_config", __name__, url_prefix="/api/config")
|
||||
|
||||
|
||||
@blueprint.get("/")
|
||||
def get_global_config():
|
||||
return jsonify(get_config())
|
||||
|
||||
|
||||
@blueprint.put("/")
|
||||
def modify_global_config():
|
||||
return jsonify(request.json)
|
||||
|
||||
|
||||
@blueprint.post("/write")
|
||||
def write_global_config():
|
||||
return jsonify({
|
||||
"result": write_config()
|
||||
})
|
||||
|
||||
|
||||
@blueprint.post("/load")
|
||||
def load_global_config():
|
||||
return jsonify({
|
||||
"result": load_config()
|
||||
})
|
Reference in New Issue
Block a user