Migrating an existing REST API (NodeJS/Express) to serverless using Lambda/API Gateway with ClaudiaJS and AWS-Serverless-Express

Migrating to serverless is a necessary procedure for many companies now, for lowering down the costs of the infrastructure and for increasing reliability of the systems.

The Question

Is it possible to migrate to API Gateway/Lambda a whole application with no effort and maintaining the compatibility with the original machine?

The answer is “yes” and this tutorial explains how it is possible to achieve this goal in minutes and not in weeks. Continue reading “Migrating an existing REST API (NodeJS/Express) to serverless using Lambda/API Gateway with ClaudiaJS and AWS-Serverless-Express”

Should we use Node.JS for enterprise solutions? No, never!

I have many reasons why to avoid the use of Node.JS for enterprise solutions (webservices, websites, etc.), but I think that the following one is definitive:

  • Each error within a single script will make the whole application crash and will require a command-line restart

Let’s see the following example scenario:

Our Node.JS application (myapp) is a simple web app (it doesn’t matter which framework we use) that responds to the following 2 URIs: /myapp/test1/ and /myapp/test2/.
Those URIs are managed by two specific controllers: controller1.js and controller2.js.

Only controller2.js is bugged and so when /myapp/test2/ is requested by the browser it causes a fatal error.

Where’s the problem? Every web application works like that.
Yes, it is. But no other “old” application such as Php would crash within the single script error!
Let’s understand that also the other URL (/myapp/test1/) that contained the not bugged code will be unavailable within the node server crash. Unlike Php applications that will continue to correctly work if there is a single script with a fatal error.

I have many other reasons for thinking that Node.JS is just a toy, and not a professional tool, but I think this issue is one of the worst behaviours I could have ever found in a modern programming language.

Some interesting articles on the equivalence between node.JS and EVIL: