Posts

Showing posts from April, 2021

MERN Stack

Image
What is a technology stack? It’s a set of frameworks and tools which is used to develop a software. These set of frameworks and tools are choose according their ability to working together and function well. MERN  (MongoDB, ExpressJS, ReactJS, NodeJS) LAMP  (Linux, Apache, MySQL, PHP) MEAN  (MongoDB, ExpressJS, AngularJS, NodeJS) MERN Stack MongoDB Express(.js) React(.js) Node(.js) Mean Stack is a JavaScript Stack that can used to built web applications easily and quickly. Each of these 4 technologies are playing a big part in developing web applications. Since these are very powerful and end-to-end framework developer can work on their projects easily.  Brief introduction about each technology, MongoDB:  NoSQL, document-oriented  database used to store application data. NodeJS:  The JavaScript runtime environment for the server side. It is used to run JavaScript on the machine rather than in a browser. ExpressJS:  A JavaScript framework that ...

NodeJS

Image

HTTP Verbs

Image
HTTP request methods What is HTTP? The main purpose of Hypertext Transfer Protocol (HTTP) is to enable communication between clients and servers. It uses the request-response method. For that HTTP defines set of request methods to identify which action should be performed for the resources. Also referred as HTTP Verbs. HTTP Methods : GET POST PUT DELETE PATCH OPTIONS HEAD The two most common HTTP methods are: GET and POST. GET GET is used to fetch data from a specified resource. Only use to only retrieve data. Retrieve all : https://sliit.lk/api/ v1/faculties Retrieve one : https://sliit.lk/api/ v1/faculties/ {faculty id} Properties of GET requests: GET requests can be cached GET requests remain in the browser history GET requests should never be used when dealing with sensitive data GET requests have length restrictions GET requests are Safe (only used to request data not modify) POST POST is used to create an entry to specific resource. Data sent to ...

S.O.L.I.D Principles

Image
S.O.L.I.D is a group of five object-oriented design (OOD) principles (rules) that should be followed when designing software. SOLID was promoted by Robert C. Martin but the name itself was created by Michael Feathers. These 5 principles have changed the way that we write software, it allows programmers to write code better, easier to understand and change later. SOLID stands for: S   -   Single-responsibility Principle O     -  Open-closed Principle L    -   Liskov Substitution Principle I     -   Interface Segregation Principle D  -    Dependency Inversion Principle 01.Single-Responsibility Principle “A class should have one and only one reason to change, meaning that a class should have only one job” Let's see a few of its benefits: Testing  – A class with one responsibility means few test cases are required. Lower coupling  – A single class will have Few depend...