Node.js is a JavaScript backend for service side scripting. If you are familiar with JavaScript, it is a client side scripting. Basically, you can imagine Node.js as JavaScript for server. That is really interesting as you can JavaScript client and server side.
var http = require(‘http’);
http.createServer(function (req, res) {
res.writeHead(200, {‘Content-Type’: ‘text/plain’});
res.end(‘Hello World!’);
}).listen(8080);
w3schools
Starting NodeJs
Usually, I will Hello World as my starting point. Although it is quite simple, it took me a while to get used to Node.js. This is because I am very used to JS as a client side scripting language. You will also need to run npm (node package manager) for some of the JS library. In terms of syntax, there are many similarities between Node.js and PHP. Of course, the best part is the reuse of JS on server side.
ODA Node.js SDK
One reason for playing Node.js was testing of Oracle Digital Assistant (ODA) Node.js SDK. It was required in the integration of ODA to another channel like Telegram. ODA also use Node.js as its custom component. To utilise this SDK, you end up having to learn Node.js and npm. On how to setup, that will be another post.
Node.js is a lightweight container type of scripting language. It can exist by its own package. Perhaps this is why it was used as custom component for ODA. However, it creates the need for this skillset for maintainability of ODA.