Compare commits
4 Commits
v0.0.5
...
73d0d767e9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73d0d767e9 | ||
|
|
4050c08859 | ||
|
|
fac79b70b6 | ||
|
|
000d1db6b1 |
@@ -146,3 +146,4 @@ jobs:
|
|||||||
labels: ${{ steps.meta-frontend.outputs.labels }}
|
labels: ${{ steps.meta-frontend.outputs.labels }}
|
||||||
build-args: |
|
build-args: |
|
||||||
VITE_APP_VERSION=${{ steps.generate.outputs.new_tag }}
|
VITE_APP_VERSION=${{ steps.generate.outputs.new_tag }}
|
||||||
|
VITE_BASE_URL=https://todo.almazlar.com/api
|
||||||
|
|||||||
@@ -1,3 +1,11 @@
|
|||||||
|
## [v0.0.7] - 2026-02-22
|
||||||
|
|
||||||
|
* fix: update API base URL and add healthcheck for backend service (4050c08)
|
||||||
|
|
||||||
|
## [v0.0.6] - 2026-02-22
|
||||||
|
|
||||||
|
* fix: update database connection URL and configure frontend build context (000d1db)
|
||||||
|
|
||||||
## [v0.0.5] - 2026-02-21
|
## [v0.0.5] - 2026-02-21
|
||||||
|
|
||||||
* fix: add missing comma in settings.json for Java configuration (73c2147)
|
* fix: add missing comma in settings.json for Java configuration (73c2147)
|
||||||
|
|||||||
@@ -24,20 +24,29 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "8082:8080"
|
- "8082:8080"
|
||||||
environment:
|
environment:
|
||||||
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5433/tododb
|
- SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/tododb
|
||||||
- SPRING_DATASOURCE_USERNAME=postgres
|
- SPRING_DATASOURCE_USERNAME=postgres
|
||||||
- SPRING_DATASOURCE_PASSWORD=postgres
|
- SPRING_DATASOURCE_PASSWORD=postgres
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -f http://localhost:8080/actuator/health || exit 1"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build: ./frontend
|
build:
|
||||||
|
context: ./frontend
|
||||||
|
args:
|
||||||
|
VITE_BASE_URL: "http://localhost:8082/api"
|
||||||
container_name: todo-frontend
|
container_name: todo-frontend
|
||||||
ports:
|
ports:
|
||||||
- "5173:80"
|
- "5173:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ RUN npm install
|
|||||||
COPY . .
|
COPY . .
|
||||||
ARG VITE_APP_VERSION=dev
|
ARG VITE_APP_VERSION=dev
|
||||||
ENV VITE_APP_VERSION=${VITE_APP_VERSION}
|
ENV VITE_APP_VERSION=${VITE_APP_VERSION}
|
||||||
|
|
||||||
|
ARG VITE_BASE_URL=https://todo.almazlar.com/api
|
||||||
|
ENV VITE_BASE_URL=${VITE_BASE_URL}
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Run stage
|
# Run stage
|
||||||
|
|||||||
@@ -1,4 +1,12 @@
|
|||||||
const BASE_URL = 'https://todo.almazlar.com/api/todos';
|
// src/services/api.js
|
||||||
|
// Vite automatically injects the variable defined in .env.* based on the current mode.
|
||||||
|
// `import.meta.env.VITE_BASE_URL` is the single source of truth for the API root.
|
||||||
|
|
||||||
|
const BASE_URL = import.meta.env.VITE_BASE_URL + '/todos';
|
||||||
|
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
// API helpers
|
||||||
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
export const getTodos = async () => {
|
export const getTodos = async () => {
|
||||||
const response = await fetch(BASE_URL);
|
const response = await fetch(BASE_URL);
|
||||||
@@ -35,7 +43,6 @@ export const deleteTodo = async (id) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getVersion = async () => {
|
export const getVersion = async () => {
|
||||||
// Use the origin to ensure it accesses the /api/version correctly regardless of environment
|
|
||||||
const VERSION_URL = BASE_URL.replace('/todos', '/version');
|
const VERSION_URL = BASE_URL.replace('/todos', '/version');
|
||||||
const response = await fetch(VERSION_URL);
|
const response = await fetch(VERSION_URL);
|
||||||
if (!response.ok) throw new Error('Failed to fetch version');
|
if (!response.ok) throw new Error('Failed to fetch version');
|
||||||
|
|||||||
Reference in New Issue
Block a user