mirror of
				https://github.com/aleleba/test-list-app.git
				synced 2025-11-04 07:54:47 -06:00 
			
		
		
		
	Merge pull request #4 from aleleba/PR-994018
PR-994018: Adding support to Prefix url.
This commit is contained in:
		@@ -4,3 +4,5 @@ ENV= #Default production
 | 
				
			|||||||
PORT= #Default 80
 | 
					PORT= #Default 80
 | 
				
			||||||
#Host
 | 
					#Host
 | 
				
			||||||
HOST= #Default localhost
 | 
					HOST= #Default localhost
 | 
				
			||||||
 | 
					#Prefix URL
 | 
				
			||||||
 | 
					PREFIX_URL= #Default ''
 | 
				
			||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "test-list-app",
 | 
					  "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",
 | 
					  "description": "Starter Kit of server side render of react with backend in go",
 | 
				
			||||||
  "scripts": {
 | 
					  "scripts": {
 | 
				
			||||||
    "start": "cd build/server && ./react-server",
 | 
					    "start": "cd build/server && ./react-server",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,9 +3,10 @@ import PrincipalRoutes from './PrincipalRoutes';
 | 
				
			|||||||
import { config } from '../../../config';
 | 
					import { config } from '../../../config';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const App = () => {
 | 
					const App = () => {
 | 
				
			||||||
 | 
						const { PREFIX_URL } = config;
 | 
				
			||||||
	if(config.ENV === 'development') {
 | 
						if(config.ENV === 'development') {
 | 
				
			||||||
		useEffect(() => {
 | 
							useEffect(() => {
 | 
				
			||||||
			const ws = new WebSocket(`wss://${config.HOST}/ws`);
 | 
								const ws = new WebSocket(`wss://${config.HOST}${PREFIX_URL}/ws`);
 | 
				
			||||||
			ws.onmessage = (event) => {
 | 
								ws.onmessage = (event) => {
 | 
				
			||||||
				if (event.data === 'reload') {
 | 
									if (event.data === 'reload') {
 | 
				
			||||||
					window.location.reload();
 | 
										window.location.reload();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user