Posts

Showing posts from April, 2018

Create a basic web Server using express

Image
A Framework gives a proper structure to our applications. And it makes our application code maintainable and understandable. There are various frameworks for building applications and web Servers. And Express is one of the most popular Frameworks for building applications.it is a fast, lightweight and well documented framework. And those characteristics became a obvious cause for its popularity. Creating a basic web Server using express Download express Before install express Node.js should be installed. Create a folder and open a terminal inside in that folder.  to create the package JASON file first run npm init --yes command. To install express.js run npm i express command Let’s start coding Open your favorite IDE and select the newly created folder as the workspace. Next create a javaScript filecalled app.js. In the first line express module has loaded using require method which returns another function. In the second ...

Introduction to RESTful Services

Image
I n this article, I gave a brief introduction to RESTful Services. Let’s begin with the client server architecture. Most applications these days follow this architecture. The communication between client and server happen using HTTP protocol. On the server we expose a bunch of services that are accessible via the HTTP protocol. The client can directly call the services by sending HTTP request.  Now this is where REST comes in to the picture. REST or REpresentational  State Transfer is a simple architectural pattern for develop web Services. According to Wikipedia REST “is a  programming  architectural implementation intended to increase the efficiency of communication in  computing  systems. It embodies the idea that the best way to share large amounts of  data  between multiple parties is to make that data available on-demand by sharing references to that data rather than a complete copy of the data itself.” Here we use simple ...

A simple application using Node.js

Image
As nodejs.org states,  Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world. Creating a Simple app using Node.js To install Node.js simply head over to nodejs.org and download the version recommended for most users and run through the installer. Once the installation is finished type node –v in the terminal to check whether Node.js is running successfully If you get something like above, you have installed Node.js successfully. Let’s start coding…… Go to your favorite IDE( here I have used webStrome) and go to New project -> Empty project and create a new folder to set project workspace  finally hit the create button. Now in that newly created folder create a javaScript file called “Server”.This is the file Node.js...