aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-28 15:58:10 +0900
committernsfisis <nsfisis@gmail.com>2024-07-28 15:58:10 +0900
commit05c44c895625d9dc4813ecbe53edefc3d8bd9b6d (patch)
tree718a8138ac6a9d1b343c1dfd87d8ca9494191e80
parentac732635747828dbe20c657362eba10840a039d2 (diff)
downloadiosdc-japan-2024-albatross-05c44c895625d9dc4813ecbe53edefc3d8bd9b6d.tar.gz
iosdc-japan-2024-albatross-05c44c895625d9dc4813ecbe53edefc3d8bd9b6d.tar.zst
iosdc-japan-2024-albatross-05c44c895625d9dc4813ecbe53edefc3d8bd9b6d.zip
feat(dev): make Remix HMR work
-rw-r--r--Makefile4
-rw-r--r--compose.yaml18
-rw-r--r--frontend/app/.server/api/client.ts7
3 files changed, 28 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 17b3b1e..023932c 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,10 @@ up:
down:
docker compose down
+.PHONY: api-server-only
+api-server-only:
+ docker compose up -d api-server-only
+
.PHONY: psql
psql: up
docker compose exec db psql --user=postgres albatross
diff --git a/compose.yaml b/compose.yaml
index 4714568..00bbd0b 100644
--- a/compose.yaml
+++ b/compose.yaml
@@ -26,6 +26,24 @@ services:
ALBATROSS_DB_NAME: albatross
restart: always
+ api-server-only:
+ build:
+ context: ./backend
+ ports:
+ - '127.0.0.1:8002:80'
+ depends_on:
+ db:
+ condition: service_healthy
+ environment:
+ ALBATROSS_DB_HOST: db
+ ALBATROSS_DB_PORT: 5432
+ ALBATROSS_DB_USER: postgres
+ ALBATROSS_DB_PASSWORD: eepei5reesoo0ov2ceelahd4Emi0au8ahJa6oochohheiquahweihoovahsee1oo
+ ALBATROSS_DB_NAME: albatross
+ restart: always
+ profiles:
+ - api-server-only
+
app-server:
build:
context: ./frontend
diff --git a/frontend/app/.server/api/client.ts b/frontend/app/.server/api/client.ts
index 12f2fc6..93a49f6 100644
--- a/frontend/app/.server/api/client.ts
+++ b/frontend/app/.server/api/client.ts
@@ -1,4 +1,9 @@
import createClient from "openapi-fetch";
import type { paths } from "./schema";
-export const apiClient = createClient<paths>({ baseUrl: "http://api-server/" });
+export const apiClient = createClient<paths>({
+ baseUrl:
+ process.env.NODE_ENV === "development"
+ ? "http://localhost:8002/"
+ : "http://api-server/",
+});