Developing Simple node.js Web Application on Our Desktop PRO

We can easily set up an up and running HTTP server on our desktop that runs a web application developed in node.js. We just need to write our code in a separated JavaScript file and execute it. var http = require(‘http’); var server = http.createServer(function (req, res) { res.writeHead(200, {‘Content-Type’:’text/plain’}); res.end(‘Hello World!\n’); }); server.listen(1400,’127.0.0.1′); The following video clip […]

Installing node.js Modules PRO

Using the npm utility we can easily install new modules into our node.js development environment. There are two modes for using the node.js package manager, also known as npm. The local mode is the default one. In order to use the global mode we should add the -g flag when using the npm command. Using the npm utility we […]

The node.js Public Modules Repository PRO

The node.js NPM (Node Package Manager) allows us to manage the packages installed on our computer. NPM provides us with an online public registry service that contains all of the packages developed by programmers who chose to publish them using NPM. NPM provides us with a tool we can use for downloading, installing the managing those […]

Using node.js with MySQL PRO

Developing a web application using the node.js framework we can easily write code that connects with a MySQL database. The mysql module provides us with everything we need. The following code sample shows how simple it is to use this module. var mysql = require(‘mysql’); var connection = mysql.createConnection({ host: ‘server.zindell.com’, user: ‘nodejsdemo’, password: ‘lifemichael’, […]

Skip to content Update cookies preferences