diff --git a/maternal-web/lib/api/client.ts b/maternal-web/lib/api/client.ts index 7366eec..eceb5c5 100644 --- a/maternal-web/lib/api/client.ts +++ b/maternal-web/lib/api/client.ts @@ -1,7 +1,7 @@ import axios from 'axios'; import { tokenStorage } from '@/lib/utils/tokenStorage'; -const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3000'; +const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:3020'; export const apiClient = axios.create({ baseURL: API_BASE_URL, diff --git a/parentflow-admin/src/lib/api-client.ts b/parentflow-admin/src/lib/api-client.ts index f537b06..abefb73 100644 --- a/parentflow-admin/src/lib/api-client.ts +++ b/parentflow-admin/src/lib/api-client.ts @@ -35,7 +35,7 @@ class ApiClient { private async request(method: string, endpoint: string, data?: any, options?: any) { const config = { method, - url: `${API_BASE_URL}${endpoint}`, + url: `${API_BASE_URL}/api/v1${endpoint}`, headers: { 'Content-Type': 'application/json', ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}), @@ -55,7 +55,7 @@ class ApiClient { // Handle token refresh if (error.response?.status === 401 && this.refreshToken) { try { - const refreshResponse = await axios.post(`${API_BASE_URL}/auth/refresh`, { + const refreshResponse = await axios.post(`${API_BASE_URL}/api/v1/auth/refresh`, { refreshToken: this.refreshToken, }); diff --git a/start-dev.sh b/start-dev.sh index af095c6..aedef5f 100755 --- a/start-dev.sh +++ b/start-dev.sh @@ -143,7 +143,7 @@ fi # Create .env.local if it doesn't exist if [ ! -f ".env.local" ]; then cat > .env.local << EOF -NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro/api/v1 +NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro NEXT_PUBLIC_GRAPHQL_URL=https://maternal-api.noru1.ro/graphql NEXT_PUBLIC_WS_URL=wss://maternal-api.noru1.ro NEXT_PUBLIC_APP_URL=https://maternal.noru1.ro @@ -172,7 +172,7 @@ fi # Create .env.local if it doesn't exist if [ ! -f ".env.local" ]; then cat > .env.local << EOF -NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro/api/v1 +NEXT_PUBLIC_API_URL=https://maternal-api.noru1.ro NEXT_PUBLIC_APP_URL=https://pfadmin.noru1.ro NEXT_PUBLIC_APP_NAME=ParentFlow Admin EOF