O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating the Node.js Back-end

Now that the database is in place and we know how to browse collections and data in the database, we can start creating a backend powered by Node.js. To get your website to run on Node.js, all you need to do is create a JavaScript file and load it using Node. Node provides some packages that are at your disposal by using require as we have done before. The Node.js website had some Hello, Node.js! script on their website, but it was removed when the platform got more mature and the user base grew. Luckily, I still have it laying around somewhere and so we will create our first Node.js website. Put the following JavaScript code in a new file and name it index.js:

var http = require('http');var server = http.createServer(function ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required