aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/routes
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-14 22:31:32 +0900
committernsfisis <nsfisis@gmail.com>2025-08-14 22:44:16 +0900
commitbf3b2b2f5fdfe4d54226b59ce82378e4a77dc700 (patch)
treee8d6eaeab9ae28f1c66e530cbeed483db08a7098 /frontend/app/routes
parent948d7e6596bc4a37c8d7903e785e099b6a81a664 (diff)
downloadiosdc-japan-2025-albatross-bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700.tar.gz
iosdc-japan-2025-albatross-bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700.tar.zst
iosdc-japan-2025-albatross-bf3b2b2f5fdfe4d54226b59ce82378e4a77dc700.zip
feat(backend,frontend): Replace hard-coded base path with environment variable
Diffstat (limited to 'frontend/app/routes')
-rw-r--r--frontend/app/routes/_index.tsx3
-rw-r--r--frontend/app/routes/dashboard.tsx5
2 files changed, 5 insertions, 3 deletions
diff --git a/frontend/app/routes/_index.tsx b/frontend/app/routes/_index.tsx
index ef54c84..9767985 100644
--- a/frontend/app/routes/_index.tsx
+++ b/frontend/app/routes/_index.tsx
@@ -2,6 +2,7 @@ import type { LoaderFunctionArgs, MetaFunction } from "react-router";
import { ensureUserNotLoggedIn } from "../.server/auth";
import BorderedContainer from "../components/BorderedContainer";
import NavigateLink from "../components/NavigateLink";
+import { BASE_PATH } from "../config";
export const meta: MetaFunction = () => [
{ title: "PHPerKaigi 2025 Albatross" },
@@ -16,7 +17,7 @@ export default function Index() {
return (
<div className="min-h-screen bg-sky-600 flex flex-col items-center justify-center gap-y-6">
<img
- src="/phperkaigi/2025/code-battle/logo.svg"
+ src={`${BASE_PATH}logo.svg`}
alt="PHPerKaigi 2025"
className="w-64 h-64"
/>
diff --git a/frontend/app/routes/dashboard.tsx b/frontend/app/routes/dashboard.tsx
index b7bfb01..75e809b 100644
--- a/frontend/app/routes/dashboard.tsx
+++ b/frontend/app/routes/dashboard.tsx
@@ -5,6 +5,7 @@ import { createApiClient } from "../api/client";
import BorderedContainerWithCaption from "../components/BorderedContainerWithCaption";
import NavigateLink from "../components/NavigateLink";
import UserIcon from "../components/UserIcon";
+import { BASE_PATH } from "../config";
export const meta: MetaFunction = () => [
{ title: "Dashboard | PHPerKaigi 2025 Albatross" },
@@ -76,8 +77,8 @@ export default function Dashboard() {
<a
href={
process.env.NODE_ENV === "development"
- ? "http://localhost:8003/phperkaigi/2025/code-battle/admin/dashboard"
- : "/phperkaigi/2025/code-battle/admin/dashboard"
+ ? `http://localhost:8003${BASE_PATH}admin/dashboard`
+ : `${BASE_PATH}admin/dashboard`
}
className="text-lg text-white bg-sky-600 px-4 py-2 rounded-sm transition duration-300 hover:bg-sky-500 focus:ring-3 focus:ring-sky-400 focus:outline-hidden"
>