diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..620c5e1e --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v22.9.0 diff --git a/front/.env.development b/front/.env.development new file mode 100644 index 00000000..cfc9f71e --- /dev/null +++ b/front/.env.development @@ -0,0 +1 @@ +NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000 \ No newline at end of file diff --git a/front/.env.production b/front/.env.production new file mode 100644 index 00000000..cfc9f71e --- /dev/null +++ b/front/.env.production @@ -0,0 +1 @@ +NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000 \ No newline at end of file diff --git a/front/package-lock.json b/front/package-lock.json index ea0b4b58..33a69aab 100644 --- a/front/package-lock.json +++ b/front/package-lock.json @@ -1,12 +1,12 @@ { "name": "whombat-front", - "version": "0.6.1", + "version": "0.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "whombat-front", - "version": "0.6.1", + "version": "0.7.0", "dependencies": { "@headlessui-float/react": "^0.13.3", "@headlessui/react": "^1.7.19", diff --git a/front/src/app/api.ts b/front/src/app/api.ts index a81e60ee..c4d680bf 100644 --- a/front/src/app/api.ts +++ b/front/src/app/api.ts @@ -1,7 +1,7 @@ import createAPI from "@/lib/api"; const api = createAPI({ - baseURL: "http://localhost:5000", + baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`, withCredentials: true, }); diff --git a/front/src/lib/api/common.ts b/front/src/lib/api/common.ts index 0a3e9475..b0cb775c 100644 --- a/front/src/lib/api/common.ts +++ b/front/src/lib/api/common.ts @@ -4,9 +4,10 @@ import { z } from "zod"; import { GetManySchema } from "@/lib/schemas"; -export const HOST = "http://localhost:5000"; +export const HOST = `${process.env.NEXT_PUBLIC_BACKEND_HOST}`; export const BASE_ROUTE = `/api/v1`; + export const instance = axios.create({ withCredentials: true, baseURL: HOST, diff --git a/front/src/lib/api/index.ts b/front/src/lib/api/index.ts index 12740cfa..e3e27e4f 100644 --- a/front/src/lib/api/index.ts +++ b/front/src/lib/api/index.ts @@ -36,7 +36,7 @@ type APIConfig = { }; const DEFAULT_CONFIG: APIConfig = { - baseURL: "http://localhost:5000", + baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`, withCredentials: true, };