Install the playground directory with all the code examples available on this site following this article: Programming examples on GitHub. This is an example of minimal web server written in Node that responds with a "Hello World" message to every web request. Res.writeHead(200, ) Ĭonsole.log('Simple web running on CORE9G25') Web1.js, add the follow contect to the web1.js file Now we are ready to try the first nodejs example from its web site. Debian tutorials - How to install node.js on squeeze or wheezyĪt prompt ">" type console.log("Hello") to see if it works.Install packages required to compile the source code:ĭownload the latest source code from :Įnter the directory we just extracted from the tar archive Node.js enables web developers to create an entire web application in JavaScript, both server-side and client-side. Node.js contains a built-in HTTP server library, making it possible to run a web server without the use of external software, such as Apache or Lighttpd, and allowing more control of how the web server works. Pratically this article is a copy of the original version available here tested on an CORE9G25 with Kernel 3.11 and EmDebian Grip Wheezy 7.1. Note that, instead of using port 1337, you can use any port number of your choice which is currently not in use by any other service. The server will listen on port 1337, and will send Hello, World to the browser upon a GET request. Programs are written on the server side in JavaScript, using event-driven, asynchronous I/O to minimize overhead and maximize scalability. In this example we’ll show how to create an HTTP server using Node.js. Node.js is a server-side software system designed for writing scalable Internet applications, notably web servers.
0 Comments
Leave a Reply. |