Zone of Development

by Damiano Abballe

Category: Node.js

Node.js – Create a web site with express

In this post, we will see how to create a web site in Node.js using express. First of all, we open an editor (in my case Visual Studio Code), select the folder where we want to create our project and from the terminal we run the command npm init: Then, we run the command npm […]

Read More

Node.js – How to create a REST API

In this post, we will see how to create a Rest API with Node.js and Express. First of all, what is Express?Express is an open source web framework that helps us to make developing websites, web apps, & API’s much easier.It supports many templating engines and it is very simple to use. In order to […]

Read More

Node.js – How to connect to MySQL

In this post, we will see how to connect a Node application with the MySQL Db called “DbManagerUser”, created in the post: MySQL – How to create a DB. First of all, we open Visual Studio Code, we open a terminal and we install the MySQL Module, using the command npm install mysqlThen, we create an […]

Read More

Node.js – How to use pipe()

In this post, we will see how pipe works and how we can use it. First of all, what is a pipe?The pipe() function reads data from a readable stream as it becomes available and writes it to a destination writable stream.In the previous post Node.js – Streams, we have read a file and we […]

Read More

Node.js – Streams

From internet:“Streams are a way to handle reading/writing files, network communications, or any kind of end-to-end information exchange in an efficient way.What makes streams unique, is that instead of a program reading a file into memory all at once like in the traditional way, streams read chunks of data piece by piece, processing its content without keeping […]

Read More

Azure – How to deploy a Node.js application

In this post, we will see how to deploy a Node.js application in Azure, using Visual Studio Code. First of all, we have to create a Web App in Azure.We open a browser, go to Azure portal and we select the item “Create a resource”: then, we select the resource “Web App”: Now, we create […]

Read More

Node.js – How to create a HTTP server

In this post, we will see hot to create a HTTP server using Node.js.Node.js has a module called HTTP, which allows to transfer data using HTTP.With this module we can create an HTTP server that listens to server ports and gives a response back to the client. We open Visual Studio Code, create a new […]

Read More

Node.js – How to manage files (Create, Modify and Delete a file)

In this post, we will see how to create, modify and delete a file with Node.js.For this post, we will use the file manageFile.js created in the postHow to manage file with Node.js – Part I (Read a file)and a new file called FinalManage.js: [FinalManageFile.js] CREATE AN EMPTY FILE:We add the method CreateFile in manageFile.js: […]

Read More

Node.js – How to manage files (Read a file)

In this post, we will see how to read a file using Node.js. DETERMINING THE EXISTENCE OF A FILE IN A DIRECTORY:[readfile.js] If we run the application, this will be the result in case of “file found in the directory”: Instead, this will be the result in case of “file didn’t find in the directory”: […]

Read More

Node.js – Modules

When we are developing an application with Node.js, we could put all functionalities into one single huge file. For the Node.js interpreter this isn’t a problem but, we could have problems in terms of code organization.It is a best practice breaking down our huge files in more small files.In node.js a functionality organized in single […]

Read More