How to create your first web application with Node.js and Express
As we see in this article, Node.js is a language very powerful, but it has not an application server embedded.
To expose your application on the Internet, you need an application server, and the most used, well documented and simple is Express.
Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
This framework provides a thin layer of fundamental web application features, without obscuring Node.js.
To use Express you just
- insert
"express" : "<version>"
intodependencies
section ofpackage.json
file and then executenpm install
, or - run
npm install express -save
command.
After that you could start to write your code and you have a simple Node.js application that uses Express.
This is the same identical application we saw in the previous article, but it is more concise. Express, in fact, create itself an HTTP server, so it is no more necessary to use http
module.
Originally published at https://gabriele-decapoa.github.io.