Merge pull request #4 from aleleba/PR-994018

PR-994018: Adding support to Prefix url.
This commit is contained in:
Alejandro Lembke Barrientos 2023-10-17 12:35:16 -06:00 committed by GitHub
commit 1fa7a35685
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -3,4 +3,6 @@ ENV= #Default production
#App Port
PORT= #Default 80
#Host
HOST= #Default localhost
HOST= #Default localhost
#Prefix URL
PREFIX_URL= #Default ''

View File

@ -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",

View File

@ -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();