I'm in!
See original GitHub issueIf you are like me, it’s nice to dig around and follow along when source code is provided. There were a couple hurdles getting running on this one so I figured I’d share.
Server side
This is using a newer-ish version node.js
's import syntax so you will need to use nvm to swap over to somewhere around 15.8.0
using nvm
. You can install nvm using:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
Once installed:
nvm install 15.8.0
Simon seems to have removed server/package.json
. I was able to fill in the blanks and this worked fine for me:
{
"name": "server",
"version": "0.1.0",
"private": true,
"dependencies": {
"gl-matrix": "^3.3.0",
"socket.io": "^3.1.1"
},
"scripts": {
"start": "node index.mjs"
}
}
Once you have that set done you can run the following to start the server:
npm install
node index.mjs
Leave this running in a separate terminal.
Client side
Install http-server
sudo npm install -g http-server
Then run a simple http-server to serve up the files. If you don’t do this you will get CORS issues.
$ http-server
Starting up http-server, serving ./
Available on:
http://127.0.0.1:8081
http://192.168.1.129:8081
http://10.0.7.10:8081
http://192.168.96.1:8081
Hit CTRL-C to stop the server
I was able to see the login screen, walk around and kill some monsters named after my username lol.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:21
- Comments:22 (1 by maintainers)
Top GitHub Comments
@Unusualiscool What did you do to get the websocket error? After you built the package.json inside the server folder per @Addyvan instructions, you should run npm install via command prompt while in the server directory. That should install what you need. Then run npm start while in that directory. Leave that running. In a new command prompt window, change directory over to the client folder and run: npm install -g http-server Then run http-server The window will tell you the url and port you can hit from your browser. For me it was, http://127.0.0.1:8080/
@Addyvan you’re savior