Skip to content

Commit

Permalink
Implement proper env handling for frontend #3
Browse files Browse the repository at this point in the history
  • Loading branch information
capital-G committed Apr 3, 2022
1 parent 3cc738d commit 5bb731b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import vuetify from './plugins/vuetify'
import { loadFonts } from './plugins/webfontloader'
import { io } from 'socket.io-client';

loadFonts()
const socketAddress = process.env.VUE_APP_BACKEND_ADDRESS || location.protocol + "//" + location.hostname + ":3000";

const socket = io(process.env.VUE_APP_SOCKET_ENDPOINT);
loadFonts();

const socket = io(socketAddress);
socket.emit('changeSlider', 'Hello there from Vue.');

const app = createApp(App);
Expand Down

0 comments on commit 5bb731b

Please sign in to comment.