diff --git a/.github/workflows/prod-ci.yml b/.github/workflows/prod-ci.yml index c1e3d1f..e0a8170 100644 --- a/.github/workflows/prod-ci.yml +++ b/.github/workflows/prod-ci.yml @@ -62,7 +62,6 @@ jobs: echo "BACKEND_IMAGE_TAG=${{ github.sha }}" > .env echo "FRONTEND_IMAGE_TAG=${{ github.sha }}" >> .env echo "REGISTRY_USER=${{ github.repository_owner }}" >> .env - echo "BACK_API_URL=${{ secrets.BACK_API_URL }}" >> .env docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d --remove-orphans --build docker image prune -af diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 0fb3419..b73b2d4 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -10,8 +10,6 @@ services: frontend: image: ghcr.io/${REGISTRY_USER}/frontend:${FRONTEND_IMAGE_TAG} - environment: - - VITE_API_URL=${BACK_API_URL} ports: - "8081:80" restart: always diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 65c16bd..b618005 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -1,9 +1,6 @@ import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; import { Suspense } from 'react'; -import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'; -import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; -import { Suspense } from 'react'; import Home from './pages/Home'; import NotFound from './pages/NotFound'; import CadastroUsuario from './pages/CadastroUsuario'; diff --git a/frontend/src/utils/apiUrl.js b/frontend/src/utils/apiUrl.js index 466215f..73131f2 100644 --- a/frontend/src/utils/apiUrl.js +++ b/frontend/src/utils/apiUrl.js @@ -1 +1 @@ -export const API_URL = process.env.VITE_API_URL || 'http://localhost:8080'; +export const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:8080';