Thursday, August 26, 2021

Express



In this tutorial, we will also have a look at the express framework. This framework is built in such a way that it acts as a minimal and flexible Node.js web application framework, providing a robust set of features for building single and multipage, and hybrid web application.
What is Express.js?

Express.js is a Node js web application server framework, which is specifically designed for building single-page, multi-page, and hybrid web applications.

It has become the standard server framework for node.js. Express is the backend part of something known as the MEAN stack.

The MEAN is a free and open-source JavaScript software stack for building dynamic web sites and web applications which has the following components;

1) MongoDB - The standard NoSQL database

2) Express.js - The default web applications framework

3) Angular.js - The JavaScript MVC framework used for web applications

4) Node.js - Framework used for scalable server-side and networking applications.

The Express.js framework makes it very easy to develop an application which can be used to handle multiple types of requests like the GET, PUT, and POST and DELETE requests. Installing and using ExpressExpress gets installed via the Node Package manager. This can be done by executing the following line in the command line


npm install express

The above command requests the Node package manager to download the required express modules and install them accordingly.
  • npm install express --save
Let's use the newly installed Express framework and create a simple "Hello World" application.

create a simple server module which will listen on port no 3000. In this example, if a request is made through the browser on this port no, then server application will send a 'Hello' World' response to the client.

Node.js Express FrameWork Tutorial - Learn in 10 Minutes
var express=require('express');
var app=express();
app.get('/',function(req,res)
{
res.send('Hello World!');
});
var server=app.listen(3000,function() {}); 


Code Explanation:
In our first line of code, we are using the require function to include the "express module."

Before we can start using the express module, we need to make an object of the express module.

Here we are creating a callback function. This function will be called whenever anybody browses to the root of our web application which is http://localhost:3000. The callback function will be used to send the string 'Hello World' to the web page.
In the callback function, we are sending the string "Hello World" back to the client. The 'res' parameter is used to send content back to the web page. This 'res' parameter is something that is provided by the 'request' module to enable one to send content back to the web page.

We are then using the listen to function to make our server application listen to client requests on port no 8000. You can specify any available port over here.

Output:
Node.js Express FrameWork Tutorial - Learn in 10 Minutes


modules which installed with express

  • npm install body-parser -save
  • npm install cookie-parser -save
  • npm install multer --save


Saas

Software AS A Service(SAAS)

Software as a service (SaaS) is a model for the distribution of software where customers access software over the Internet. In SaaS, a service provider hosts the application at its data center and a customer accesses it via a standard web browser.

There are a few major characteristics that apply to most SaaS vendors:
Updates are applied automatically without customer intervention
The service is purchased on a subscription basis
No hardware is required to be installed by the customer

Why we use Saas?

SaaS offers significant benefits for organizations. Firstly, organizations don’t need an initial investment for hardware, as the processing power is supplied by the cloud provider. Likewise, there are no initial setup costs. The scalability features allow you to scale up resources on demand. You can provide privilege-based access by customizing settings. You don’t have to worry about updates or patches, and maintenance is handled by the cloud provider. As the applications are centrally hosted and remotely delivered to devices, you can access resources from any location and at any time. Most importantly, you can use any device to access resources.


Advantages of Sass:

  • It allows writing clean CSS in a programming construct.
  • It helps in writing CSS quickly.
  • It is a superset of CSS, which helps designers and developers work more efficiently and quickly.
  • As Sass is compatible with all versions of CSS, we can use any available CSS libraries.
  • It is possible to use nested syntax and useful functions such as color manipulation, mathematics and other values.



 

PHP

 PHP is a server scripting language and a powerful tool for making dynamic and interactive Web pages.

PHP is a widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.

PHP 7 is the latest stable release.



<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?>

</body>
</html>






What is PHP?

PHP is an acronym for "PHP: Hypertext Preprocessor"
PHP is a widely-used, open source scripting language
PHP scripts are executed on the server
PHP is free to download and use

What is a PHP File?

PHP files can contain text, HTML, CSS, JavaScript, and PHP code

PHP code is executed on the server, and the result is returned to the browser as plain HTML

PHP files have extension ".php


What Can PHP Do?

PHP can generate dynamic page content
PHP can create, open, read, write, delete, and close files on the server
PHP can collect form data
PHP can send and receive cookies
PHP can add, delete, modify data in your database
PHP can be used to control user-access
PHP can encrypt data

Why PHP?

  • PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
  • PHP is compatible with almost all servers used today (Apache, IIS, etc.)
  • PHP supports a wide range of databases
  • PHP is free. Download it from the official PHP resource: www.php.net
  • PHP is easy to learn and runs efficiently on the server-side



Express

In this tutorial, we will also have a look at the express framework. This framework is built in such a way that it acts as a minimal an...