diff --git a/frontend/.env b/frontend/.env new file mode 100644 index 0000000..a431aa5 --- /dev/null +++ b/frontend/.env @@ -0,0 +1 @@ +VITE_API_URL=https://atcoder-random-picker-be.fly.dev \ No newline at end of file diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 9ac34c3..a4c1453 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -26,8 +26,9 @@ errorMessage = null; try { + const API_URL = import.meta.env.VITE_API_URL; const res = await fetch( - `http://127.0.0.1:3000/?under=${under_diff}&over=${over_diff}` + `${API_URL}/?under=${under_diff}&over=${over_diff}` ); if (!res.ok) { @@ -50,9 +51,9 @@ {#if errors.rangeError}
最低Diffが最高Diffを超えています。
{:else if errors.isMinusOverDiff} -最低Diffが負の値になっています。
+最高Diffが負の値になっています。
{:else if errors.isMinusUnderDiff} -最高Diffが負の値になっています
+最低Diffが負の値になっています
{/if} {#if errorMessage} diff --git a/package.json b/package.json index 60a6445..53a6422 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ }, "scripts": { "be": "cd backend && cargo run", + "be-deploy": "cd backend && fly deploy", "fe": "cd frontend && bun run dev", + "fe-deploy": "cd frontend && bun run build", "tw": "cd frontend && npx @tailwindcss/cli -i ./src/input.css -o ./src/output.css --watch", "dev": "npm-run-all --parallel be fe", "log": "git log --all --graph --oneline"