Spring Framework for Java has been around past 15 years since its initial release. Most of the web developers prefer spring to build enterprise level web apps. But since last 3-4 years the Javascript has become more popular not only in the client-side development(Angular and React) but also towards the server-side development, thanks to nodejs. … Continue reading Java-Spring or JavaScript-Node.js?
Tag: expressjs
Building a REST API in NodeJS, Express and MongoDB
REST stands for Representational state transfer. A REST API defines a set of functions which developers can perform requests and receive responses via HTTP protocol such as GET, POST, DELETE, PUT, PATCH. A Real World Example: Facebook provides a REST API which you can query to get the number likes, you can provide a search … Continue reading Building a REST API in NodeJS, Express and MongoDB
Nodejs on the rocks: Express.js
MEAN Express JS is a web framework which makes it easier to build a web server in Node JS. Express helps in writing the NodeJS code cleanly. Installation npm install express --save Building and running HTML on a web server No need to mention header with Content-Type etc. like done before in nodejs. var express … Continue reading Nodejs on the rocks: Express.js
Node JS:101
MEAN Node JS: Web Server Part Creating a Simple Web Server var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World How are you !'); }).listen(8080,'localhost'); Executing the above code in Node will create a web server and when you will send the request to server using a browser it … Continue reading Node JS:101