Skip to content

Commit

Permalink
fix(api): add client api proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mefjus committed Apr 16, 2021
1 parent 22e76de commit 46e4553
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions packages/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions packages/client/public/_redirects
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/api/* https://app-my-home.herokuapp.com/:splat 200
/* /index.html 200
3 changes: 1 addition & 2 deletions packages/client/src/providers/api/AxiosProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down

0 comments on commit 46e4553

Please sign in to comment.