Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nodejs howto or wiki
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Mon Jun 30, 2014 1:38 pm    Post subject: nodejs howto or wiki Reply with quote

I'm getting starting using nodejs I've installed it on my RaspPi. Now I'd like to run it on Gentoo.

net-libs/nodejs-0.10.21

I'm running nginx on port 80. So I'll go with 8000 or 8080 on nodejs.

I noticed the docs at /usr/share/doc/nodejs-0.10.21

I've search the web for a gentoo howto and did not find anything.

Please throw me a bone.


This is how node is started on my RPi

root@rpi:~# more /etc/init.d/nodejs.sh
#!/bin/bash

NODE=/opt/node/bin/node
SERVER_JS_FILE=/home/pi/node/server.js
USER=pi
OUT=/home/pi/node/logs/nodejs.log

case "$1" in

start)
echo "starting node: $NODE $SERVER_JS_FILE"
sudo -u $USER $NODE $SERVER_JS_FILE > $OUT 2>$OUT &
;;

stop)
killall $NODE
;;

*)
echo "usage: $0 (start|stop)"
esac

exit 0
root@rpi:~#
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
cwc
Veteran
Veteran


Joined: 20 Mar 2006
Posts: 1080
Location: Tri-Cities, WA USA

PostPosted: Tue Jul 01, 2014 12:07 pm    Post subject: Reply with quote

https://github.com/chovy/node-startup

test.js
I'm going to give this a try with:
var sys = require("sys"),
my_http = require("http");
my_http.createServer(function(request,response){
sys.puts("I got kicked");
response.writeHeader(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8080);
sys.puts("Server Running on 8080");

as my test.js server
_________________
Without diversity there can be no evolution:)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum