arjanfrans / realtime-multiplayer-in-html5

:computer::earth_africa::computer: Realtime multiplayer game in the browser.
MIT License
22 stars 10 forks source link

Setting up on virtual server #17

Closed jasonchitla closed 1 year ago

jasonchitla commented 7 years ago

Hi, I'm trying to set up this node app on Digital Ocean and feel really close to get it working. I have a Ubuntu NodeJS 6.9.5 on 14.04 instance from Digital Ocean running, and I'm trying to run the node app with nginx and Passenger with resources such as the following: https://www.phusionpassenger.com/library/walkthroughs/deploy/nodejs/ownserver/nginx/oss/trusty/deploy_app.html

I think I'm not setting up the correct ports/paths to things and editing firewall correctly. I'm also confused in general how the setup in the aforementioned article would work because when running this node app locally I have to call both "npm start" and "npm run client."

Any clarity would help :)

arjanfrans commented 7 years ago

You have to run npm build to generate the static html page for the game client. You have to deploy those to your server and setup Nginx to read those static files. This should not be too much of a problem.

If I have some time this week I'll try deploying it too. I haven't tried it before.

jasonchitla commented 7 years ago

Thanks, I got it to work. I have nginx and passenger working together to serve the index.html file in the root of the project. My problem was that in index.html, I had to change "bundle.js" to "./dist/bundle.js" and before that I had to call "npm build" like you said. The only problem right now is that I still have to separately call "npm start" in terminal of my ubuntu server to get the server running. I thought passenger would handle this after I am setting "passenger_startup_file" to "./server/index.js" but its not right now. I'll let you know if I fix it.