Node.js
A Server side solution for Web Programming...
One of the biggest obstacles Internet faced to build automaton applications and utilities was that it mostly ran on the Client, which is the Web browser the users have. While the browser allows many interesting things, it couldn't handle data streaming or management using only HTML and even JavaScript ran only on the browser. Cookies were one of the first alternatives implemented to solve the problem by storing values of a given user and reloading them with every session, but even they were prone to deletion and were not enough to allow the user to control machines or more complex applications.
WIth the advent of HTML5 and more powerful JavaScript technologies, came PHP and other server side solutions that allowed for database management and application control and communication between clients and servers. It was still clunky and difficult to code.
Now the future comes in the form of Node.js, a framework designed to easily code Server side JavaScript and attach other applications and services.
I've read some tutorials these days, so far this is the one that has served me better:
http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js
https://github.com/maxogden/art-of-node/#the-art-of-node
I'll upload the code I've been building below to be used as reference for those interested in making their own Node.js applications.
WIth the advent of HTML5 and more powerful JavaScript technologies, came PHP and other server side solutions that allowed for database management and application control and communication between clients and servers. It was still clunky and difficult to code.
Now the future comes in the form of Node.js, a framework designed to easily code Server side JavaScript and attach other applications and services.
I've read some tutorials these days, so far this is the one that has served me better:
http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js
https://github.com/maxogden/art-of-node/#the-art-of-node
I'll upload the code I've been building below to be used as reference for those interested in making their own Node.js applications.
Installing NodeJS in Linux Mint
NodeJS is now at version 6 which means install instructions have changed. I downloaded the binaries from the nodejs homepage and proceeded to untar them with the command:
$ cd /usr/local/
$ sudo tar --strip-components 1 -xf ~/<INSTALL_DIRECTORY>/node-v6.7.0-linux-x64.tar.xz
This will ensure our application distributes the elements as needed and once finished we can test with
$ node -v
$ npm -v
Apparently even after this they've had issues with legacy code so its necessary to use:
$ npm -g install npm
$ cd /usr/local/
$ sudo tar --strip-components 1 -xf ~/<INSTALL_DIRECTORY>/node-v6.7.0-linux-x64.tar.xz
This will ensure our application distributes the elements as needed and once finished we can test with
$ node -v
$ npm -v
Apparently even after this they've had issues with legacy code so its necessary to use:
$ npm -g install npm
|
Art of Node Part II - Baby Steps.Solution to the second exercise of The Art of Node. In order to execute just use:
$ learnyournode verify index.js |
|
Node.js with MySQL.Having to learn how to use a completely new DB management application was a chore, so its great that MySQL is already ported to Node.JS! Here are some proto-functions I worked on for the DB management.
|
|
Node.js JSON Server
A simple Node JS JSON Server using the https library and the JSON.stringify function. |
[1] http://www.thegeekstuff.com/2015/10/install-nodejs-npm-linux/