[UPD] Added api to create Library
This commit is contained in:
24
app/routes/api/install.py
Normal file
24
app/routes/api/install.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from flask import request
|
||||
|
||||
from ...config import config, save_config
|
||||
from ...api.actions.install import install
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
from .blueprint import api
|
||||
|
||||
@api.route("/install", methods=["POST"])
|
||||
def post_install():
|
||||
try:
|
||||
body = request.json
|
||||
except:
|
||||
logger.debug("Installing with config.ini params")
|
||||
else:
|
||||
if body.get("query_string"):
|
||||
config["DataBase"]["query"] = body.get("query_string")
|
||||
save_config()
|
||||
finally:
|
||||
install()
|
||||
return { "status": "ok" }, 200
|
||||
|
||||
Reference in New Issue
Block a user