Question
Node.js/Socket.io client side environment variable APP patform
Hi all, I am having a problem with creating a ‘Deploy to DO’ button for my app on the APP Platform. I am having a socket.io/node.js application and I need to pass an environment variable on my client-side:
let socket = io.connect('https://some-url.com', {
reconnection: false,
transports: ['websocket'],
upgrade: false
});
I need to add an environment variable to pass the URL upon the deployment of the app. I tried with ${APP_URL}
and with process.env.APP_URL
but neither of those seems to work.
Thanks in advance!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×