i need help with node.js

Hi all,

I want to setup a webserver with node.js on the BBB rev.C. Since there is cloud9 and bonescript installed as default, it seems to be just a change of some setup files (scripts?).
Unfortunately I couldn’t find any tutorial that explains the node.js thing from the ground up. What I know is that node.js is a java interpreter and a webserver must be written. But what is then? Is it started as a service when Debian boots? Where can I find these settings.

For example: since now there is a webpage called “/Support/bone101” running. I assume that the webserver behind is a node.js webserver, isn’t it. If so, where can I change any script or config file to launch my own website?

Questions over questions…

Point your browser at the IP address of the BBB, either the Ethernet one or 192.168.7.2 which is the USB one.

It will bring up a web page that will tell you everything you need to know J

“No one could make a greater mistake than he who did nothing because he could do only a little.”

“All that is necessary for the triumph of evil is that good men do nothing” Edmond Burke (1729 - 1797)

http://www.packtpub.com/building-a-home-security-system-with-beaglebone/book

http://ca.linkedin.com/pub/bill-pretty/2b/b07/602

Thank you William,

but I knew that. My question was how to setup a webserver with node.js on the bone. I found out now that the preinstalled webpage runs on the apache server. Perhaps you have some suggestions how to make a node.js server (written with express library) autostarting.

The default webserver on port 80 is node.js...

cloud9 which also runs off node.js is on port 3000

apache is running on port 8080..

Regards,

Thank you Robert!

I tried the ports and found out what you wrote.

Regards,
Günter

I think it is important to understand that Nodejs is javascript not java. They are not interchangeable . . . So then if you would like to know how to write a web server using Nodejs, it really depends on what “libraries” you plan on using. Express, is possibly the most well known / used.

http://code.tutsplus.com/tutorials/introduction-to-express–net-33367 would be one such tutorial.

Many thanks for your help, William!

The link about express you posted is a good start. I have also found out what I was looking for regarding the setup. At this point thanks to Robert as well.

Best regards,
Günter

Here’s a simple tutorial, not of express, but it will get you started & you could adapt express in there pretty easily.

http://isolasoftware.it/2012/04/23/beaglebone-and-websockets-a-full-example-that-turn-onoff-a-led/

I’d start by getting an SSH connection to your beaglebone. Easiest way is to plug it into ethernet, find the IP (look on your router) and SSH into that. Then I’d start working through the ‘javascripting’ and ‘learn you node’ nodeschool.io tutorials:

http://nodeschool.io/#workshoppers

If you are familiar with javascript then skip the javascripting tutorial and do “learn you node”. I’m not sure I can recommend the Express tutorial there, unless they have updated it recently. There is a lot to learn in this space. Arguably working with Express requires a better understanding of HTTP than working with Apache and PHP/whatever. After the nodeschool introductions I would follow the road map here:

http://javascriptissexy.com/learn-node-js-completely-and-with-confidence/

I’ve worked my way through a lot of node.js tutorials and books and if I could go back, this is how I would do it. Good luck!

-Ryan

000

Thanx fot the tip, Ryan.

I could already do my setup with cloud9, express and all what I need -> thanks to the support that I got in the bbb community.

I am glad to be member of a community where people answer quick and with helpful information.
In Geman forums this is often not the case: everyone ist posting just for posting something. The answers are often: "I have no idea" or "I must check that" or "use Google" :-[

Regards,
Günter

Well, checking google is always a good idea. Which is how I’ve personally learned javascript, Nodejs, Express, and socket.io. But I do have well over 15 years programming experience with multiple languages, and have a fair understanding of current web technologies.

Now, if you ask some questions on these groups, you may very well get “no idea” or “google . .” but as it happens since I’ve taught myself all this Nodejs-ish / javascript stuff in the last year or so. I know the information out there is severely lacking in a few areas . . .