Skip to content

Commit

Permalink
feat: msw가 dev서버에서는 꺼짐으로 고정되도록 수정
Browse files Browse the repository at this point in the history
[#frontend]
  • Loading branch information
kyw0716 committed Aug 14, 2023
1 parent e3772b8 commit a58afa9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/stores/config/mswModeStore.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { worker } from '@mocks/browser';
import * as process from 'process';

import { store } from '@utils/external-state';
import { getAPIEndPoint } from '@utils/login';

export const mswModeStore = store<boolean>(
process.env.NODE_ENV === 'development' && getAPIEndPoint() === 'http://localhost:8080/api'
);
export const mswModeStore = store<boolean>(getAPIEndPoint() === 'http://localhost:8080/api');

export const mswModeActions = {
startMsw: async () => {
if (getAPIEndPoint() !== 'http://localhost:8080/api') {
return;
}

await worker.start({
serviceWorker: {
url: '/mockServiceWorker.js',
Expand Down

0 comments on commit a58afa9

Please sign in to comment.