forked from jakesgordon/javascript-tetris
-
Notifications
You must be signed in to change notification settings - Fork 1
Install a own Fishtris Server
Sven Anders edited this page Mar 8, 2014
·
5 revisions
https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager
curl https://www.npmjs.org/install.sh >install.sh
chmod 755 install.sh
./install.sh
npm install -p socket.io
useradd fishtris
su -s /bin/bash fishtris
git clone [email protected]:tabacha/fishtris2.git
cd fishtris2
nodejs fishtris-server.js
Now you can connect with a browser to http://localhost:8080/
If you want to listen to port 80 add as root:
iptables -t nat -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 8080
npm install -p js-beatuify
#!/bin/bash
JSB=$(which js-beautify)
if [ -z "$JSB" ] ; then
echo please install js-beautify
exit 1
else
$JSB fishtris.js >/tmp/fishtris$$.js
diff fishtris.js /tmp/fishtris$$.js
if [ $? != 0 ] ; then
echo "Please js-beautify -r fishtris.js"
exit 1
fi
$JSB fishtris-server.js >/tmp/fishtris-server$$.js
diff fishtris-server.js /tmp/fishtris-server$$.js
if [ $? != 0 ] ; then
echo "Please js-beautify -r fishtris-server.js"
exit 1
fi
rm /tmp/fishtris$$.js /tmp/fishtris-server$$.js
fi
exit 0