Skip to content

Commit

Permalink
flask index
Browse files Browse the repository at this point in the history
  • Loading branch information
wataru committed Sep 2, 2022
1 parent 414e654 commit de5fc89
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 13 additions & 2 deletions demo/serverFlask.py
Original file line number Diff line number Diff line change
@@ -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
import logging
from logging.config import dictConfig
Expand Down Expand Up @@ -37,7 +37,18 @@
}
})

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": "*"}})

class VoiceChanger():
Expand Down
2 changes: 1 addition & 1 deletion start2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# 参考: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
VOICE_CHANGER_PORT=8080

Expand Down
2 changes: 1 addition & 1 deletion trainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

ARG DEBIAN_FRONTEND=noninteractive
Expand Down

0 comments on commit de5fc89

Please sign in to comment.