Merge pull request #24 from w-okada/dev

flask index
This commit is contained in:
w-okada 2022-09-02 12:07:33 +09:00 committed by GitHub
commit 485c88d468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -1,4 +1,4 @@
from flask import Flask, request, Markup, abort, jsonify from flask import Flask, request, Markup, abort, jsonify, send_from_directory
from flask_cors import CORS from flask_cors import CORS
import logging import logging
from logging.config import dictConfig from logging.config import dictConfig
@ -37,7 +37,18 @@ dictConfig({
} }
}) })
app = Flask(__name__, static_folder="../frontend/dist", static_url_path='/')
#app = Flask(__name__, static_folder="../frontend/dist", static_url_path='/')
app = Flask(__name__)
@app.route("/<path:path>")
def static_dir(path):
return send_from_directory("../frontend/dist", path)
@app.route('/', methods=['GET'])
def redirect_to_index():
return send_from_directory("../frontend/dist", 'index.html')
CORS(app, resources={r"/*": {"origins": "*"}}) CORS(app, resources={r"/*": {"origins": "*"}})
class VoiceChanger(): class VoiceChanger():

View File

@ -2,7 +2,7 @@
# 参考:https://programwiz.org/2022/03/22/how-to-write-shell-script-for-option-parsing/ # 参考:https://programwiz.org/2022/03/22/how-to-write-shell-script-for-option-parsing/
DOCKER_IMAGE=dannadori/voice-changer:20220902_113334 DOCKER_IMAGE=dannadori/voice-changer:20220902_120553
TENSORBOARD_PORT=6006 TENSORBOARD_PORT=6006
VOICE_CHANGER_PORT=8080 VOICE_CHANGER_PORT=8080

View File

@ -1,4 +1,4 @@
FROM dannadori/voice-changer-internal:20220902_113223 as front FROM dannadori/voice-changer-internal:20220902_120454 as front
FROM debian:bullseye-slim as base FROM debian:bullseye-slim as base
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive