Merge pull request #4 from aleleba/PR-994018
PR-994018: Adding support to Prefix url.
This commit is contained in:
commit
1fa7a35685
@ -3,4 +3,6 @@ ENV= #Default production
|
||||
#App Port
|
||||
PORT= #Default 80
|
||||
#Host
|
||||
HOST= #Default localhost
|
||||
HOST= #Default localhost
|
||||
#Prefix URL
|
||||
PREFIX_URL= #Default ''
|
@ -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",
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user