Skip to content

Commit

Permalink
Merge pull request #40 from medsensio/feat/use-envs-for-endpoint
Browse files Browse the repository at this point in the history
Feat/use envs for endpoint
  • Loading branch information
mbsantiago authored Nov 8, 2024
2 parents 0bbc2ae + 571dcf6 commit ec406fa
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.9.0
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ RUN --mount=type=cache,target=/root/.cache/uv \
# Then, use a final image without uv
FROM python:3.12-slim-bookworm

# Install system dependencies, including libexpat1 and clean up the cache
RUN apt-get update && apt-get install -y --no-install-recommends \
libexpat1 \
&& rm -rf /var/lib/apt/lists/*

# Copy the application from the builder
COPY --from=builder --chown=app:app /app /app

Expand Down
1 change: 1 addition & 0 deletions front/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_BACKEND_HOST=http://localhost:5000
4 changes: 2 additions & 2 deletions front/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion front/src/app/api.ts
Original file line number Diff line number Diff line change
@@ -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,
});

Expand Down
2 changes: 1 addition & 1 deletion front/src/lib/api/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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({
Expand Down
2 changes: 1 addition & 1 deletion front/src/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type APIConfig = {
};

const DEFAULT_CONFIG: APIConfig = {
baseURL: "http://localhost:5000",
baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`,
withCredentials: true,
};

Expand Down

0 comments on commit ec406fa

Please sign in to comment.