mirror of
https://github.com/aleleba/create-react-go-ssr.git
synced 2025-07-27 01:58:13 -06:00
Configure the build and the start of the app in prod. Updating to version 0.1.1
This commit is contained in:
@ -1,15 +1,18 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import PrincipalRoutes from './PrincipalRoutes';
|
||||
import { config } from '../../../config';
|
||||
|
||||
const App = () => {
|
||||
useEffect(() => {
|
||||
const ws = new WebSocket('wss://nmr4jbx8-3000.use.devtunnels.ms/ws');
|
||||
ws.onmessage = (event) => {
|
||||
if (event.data === 'reload') {
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
if(config.ENV === 'development') {
|
||||
useEffect(() => {
|
||||
const ws = new WebSocket('wss://nmr4jbx8-3000.use.devtunnels.ms/ws');
|
||||
ws.onmessage = (event) => {
|
||||
if (event.data === 'reload') {
|
||||
window.location.reload();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
}
|
||||
|
||||
return <PrincipalRoutes />;
|
||||
};
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
func LoadEnv() {
|
||||
err := godotenv.Load("../../.env")
|
||||
if err != nil {
|
||||
log.Fatal("Error loading .env file")
|
||||
// log.Fatal("Error loading .env file")
|
||||
log.Println("Is no .env file")
|
||||
}
|
||||
}
|
@ -21,6 +21,10 @@ func main() {
|
||||
//Getting the port from the environment
|
||||
port := os.Getenv("PORT")
|
||||
|
||||
if(port == "") {
|
||||
port = "80"
|
||||
}
|
||||
|
||||
paths := utils.GetRoutes()
|
||||
|
||||
e := echo.New()
|
||||
|
Reference in New Issue
Block a user