This commit is contained in:
wataru 2022-09-14 06:55:27 +09:00
parent d71c931772
commit 46597a4c2b
2 changed files with 14 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@ import logging
from logging.config import dictConfig from logging.config import dictConfig
import sys, os import sys, os
import base64 import base64
import traceback
DATA_ROOT = "./" DATA_ROOT = "./"
dictConfig({ dictConfig({
@ -34,17 +35,20 @@ def redirect_to_index():
CORS(app, resources={r"/*": {"origins": "*"}}) CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/test', methods=['POST']) @app.route('/api/voice', methods=['POST'])
def test(): def api():
try: try:
print("POST REQUEST PROCESSING....\n")
print(request)
# filename = f"{prefix}{index:03}.zip" # filename = f"{prefix}{index:03}.zip"
# data_dir = os.path.join(DATA_ROOT, title) filename = f"AAAAAAAAAAA.zip"
# os.makedirs(data_dir,exist_ok=True) data_dir = os.path.join(DATA_ROOT)
# fullpath = os.path.join(data_dir, filename) os.makedirs(data_dir,exist_ok=True)
# data = base64.b64decode(request.json['data']) fullpath = os.path.join(data_dir, filename)
# f = open(fullpath, 'wb') data = base64.b64decode(request.json['data'])
# f.write(data) f = open(fullpath, 'wb')
# f.close() f.write(data)
f.close()
data = { data = {
"message":"OK_TEST" "message":"OK_TEST"
} }