diff --git a/.env.example b/.env.example index 6f36dfc..6aa60df 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,6 @@ ENV= #Default production #App Port PORT= #Default 80 #Host -HOST= #Default localhost \ No newline at end of file +HOST= #Default localhost +#Prefix URL +PREFIX_URL= #Default '' \ No newline at end of file diff --git a/package.json b/package.json index 9d2d875..46dbbc2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "test-list-app", - "version": "1.0.2", + "version": "1.0.3", "description": "Starter Kit of server side render of react with backend in go", "scripts": { "start": "cd build/server && ./react-server", diff --git a/src/frontend/components/App.tsx b/src/frontend/components/App.tsx index 04ae6ec..e7d1ddb 100644 --- a/src/frontend/components/App.tsx +++ b/src/frontend/components/App.tsx @@ -3,9 +3,10 @@ import PrincipalRoutes from './PrincipalRoutes'; import { config } from '../../../config'; const App = () => { + const { PREFIX_URL } = config; if(config.ENV === 'development') { useEffect(() => { - const ws = new WebSocket(`wss://${config.HOST}/ws`); + const ws = new WebSocket(`wss://${config.HOST}${PREFIX_URL}/ws`); ws.onmessage = (event) => { if (event.data === 'reload') { window.location.reload();