diff --git a/packages/api/src/main.ts b/packages/api/src/main.ts index c59d5979..10c62725 100644 --- a/packages/api/src/main.ts +++ b/packages/api/src/main.ts @@ -13,10 +13,6 @@ const bootstrap = async () => { const app = await NestFactory.create(AppModule); const config = app.get(Config); - app.enableCors({ - origin: config.clientUrl, - credentials: true, - }); app.use(cookieParser(config.cookie.secret)); app.use(helmet()); app.useGlobalInterceptors(app.get(SentryInterceptor)); diff --git a/packages/client/public/_redirects b/packages/client/public/_redirects index f8243379..80dbbe13 100644 --- a/packages/client/public/_redirects +++ b/packages/client/public/_redirects @@ -1 +1,2 @@ +/api/* https://app-my-home.herokuapp.com/:splat 200 /* /index.html 200 \ No newline at end of file diff --git a/packages/client/src/providers/api/AxiosProvider/index.tsx b/packages/client/src/providers/api/AxiosProvider/index.tsx index 9bfa44fe..b3b27944 100644 --- a/packages/client/src/providers/api/AxiosProvider/index.tsx +++ b/packages/client/src/providers/api/AxiosProvider/index.tsx @@ -6,11 +6,10 @@ import { AxiosContext } from './AxiosProvider.context'; import { AxiosProviderProps } from './AxiosProvider.types'; const AxiosProvider = ({ children }: AxiosProviderProps) => { - const API_URL = process.env.REACT_APP_API_URL; const [, setUser] = useCurrentUser(); const AxiosOverriddenInstance = axios.create({ - baseURL: API_URL, + baseURL: '/api', headers: { 'Content-Type': 'application/json', },