Continuous Integration & Continuous Deployment Tutor. NodeJs + Jenkins+ GitLab, Series #1.

Welcome Folks!

What is NodeJs?

What can we do with NodeJs?

Let’s jump into practical session of creating a NodeJs App..!

Create Your First NodeJs App

Step #1: Download & Install NodeJs.

node -v

Step #2: Download and Install VS Code

Step #3: Open VS Code and Start creating the app.

code .
{
“name”: “sample-nodejs-app”,
“description”: “This sample app is to test deploy in jenkins”,
“version”: “0.0.1”,
“private”: true,
“dependencies”: {
“express”: “4.17.1”
},
“devDependencies”: {
“mocha”: “7.0.1”,
“supertest”: “4.0.2”
}
}
npm install
//This imports the node framework -> express
var express = require(‘express’);

var app = express();
/* This responds with "hello world" message for requests that hit our "localhost:3000/" -> this url is root */
app.get(‘/’, function (request, response) {
response.send(‘Hello world!’);
});
//Server listen to port 3000 by default
app.listen(process.env.PORT || 3000);

module.exports = app;
node index.js
localhost:3000
Message from Node Server

Voila..!

Author • Freelancer • Full Stack • Designer • Android • GSoC