diff --git a/web/config/handlers.js b/web/config/handlers.js index 7afd23109..706545165 100644 --- a/web/config/handlers.js +++ b/web/config/handlers.js @@ -2,7 +2,7 @@ import { rest } from 'msw'; import { API_HOST } from '../src/env'; export const handlers = [ - rest.get(`${API_HOST}/api/config`, (req, res, ctx) => { + rest.get(`${API_HOST}api/config`, (req, res, ctx) => { return res( ctx.status(200), ctx.json({ @@ -35,7 +35,7 @@ export const handlers = [ }) ); }), - rest.get(`${API_HOST}/api/stats`, (req, res, ctx) => { + rest.get(`${API_HOST}api/stats`, (req, res, ctx) => { return res( ctx.status(200), ctx.json({ @@ -54,7 +54,7 @@ export const handlers = [ }) ); }), - rest.get(`${API_HOST}/api/events`, (req, res, ctx) => { + rest.get(`${API_HOST}api/events`, (req, res, ctx) => { return res( ctx.status(200), ctx.json( diff --git a/web/src/__mocks__/env.js b/web/src/__mocks__/env.js index 5d7b8a452..7ff1a2ac7 100644 --- a/web/src/__mocks__/env.js +++ b/web/src/__mocks__/env.js @@ -1,2 +1,2 @@ export const ENV = 'test'; -export const API_HOST = 'http://base-url.local:5000'; +export const API_HOST = 'http://base-url.local:5000/'; diff --git a/web/src/api/__tests__/index.test.jsx b/web/src/api/__tests__/index.test.jsx index 434a944a6..0c871766e 100644 --- a/web/src/api/__tests__/index.test.jsx +++ b/web/src/api/__tests__/index.test.jsx @@ -18,6 +18,6 @@ describe('useApiHost', () => { ); - expect(screen.queryByText('http://base-url.local:5000')).toBeInTheDocument(); + expect(screen.queryByText('http://base-url.local:5000/')).toBeInTheDocument(); }); }); diff --git a/web/src/env.js b/web/src/env.js index 5c830581e..99fd57635 100644 --- a/web/src/env.js +++ b/web/src/env.js @@ -1,2 +1,2 @@ export const ENV = import.meta.env.MODE; -export const API_HOST = ENV === "production" ? "" : "http://localhost:5000"; +export const API_HOST = ENV === 'production' ? '' : 'http://localhost:5000/';