Configure the build and the start of the app in prod. Updating to version 0.1.1

This commit is contained in:
2023-10-07 00:55:40 +00:00
parent ec020257e0
commit 3ea012cf93
6 changed files with 26 additions and 20 deletions

View File

@ -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 />;
};

View File

@ -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")
}
}

View 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()