アップロードのエンドポイントを変更
This commit is contained in:
2
app.py
2
app.py
@@ -772,7 +772,7 @@ def send_manifest():
|
|||||||
def send_upload(ref):
|
def send_upload(ref):
|
||||||
return cache_wrap(flask.send_from_directory("public/upload", ref), 3600)
|
return cache_wrap(flask.send_from_directory("public/upload", ref), 3600)
|
||||||
|
|
||||||
@app.route("/upload", methods=["POST"])
|
@app.route("/api/upload", methods=["POST"])
|
||||||
def upload_file():
|
def upload_file():
|
||||||
try:
|
try:
|
||||||
# POSTリクエストにファイルの部分がない場合
|
# POSTリクエストにファイルの部分がない場合
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ function uploadFiles() {
|
|||||||
const form = document.querySelector("#upload-form");
|
const form = document.querySelector("#upload-form");
|
||||||
const formData = new FormData(form);
|
const formData = new FormData(form);
|
||||||
|
|
||||||
fetch("/upload", {
|
fetch("/api/upload", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user