260 likes | 303 Views
Express is a flexible Node.js web application framework which provides a wide set of features to develop both web and mobile applications. In this video, we dive into the features of this framework and also create a basic web application using Express. We will be covering the following topic in this video:<br><br>1. What is Express Framework?<br>2. Features of Express JS<br>3. Create a basic web application using Express<br><br>This Node.js training enables you to build network applications quickly and efficiently using JavaScript. The Node.js certification training course is designed to help developers understand and build web applications with the help of JavaScript.<br><br>Node.js Training Key Features<br>1. 100% Money Back Guarantee<br>2. 36 hours of instructor-led online training<br>3. Three real-life, industry-based projects<br>4. 16 chapter-end quizzes<br>5. Master Node.js, Socket.io, Express.js with MongoDB, and SQLite<br>6. Flexibility to choose classes<br><br>Node.js Course Overview:<br>The Node. js certification training course helps you gain an in-depth knowledge of concepts such as Express.js, Node Packet Manager (NPM), shrink-wrap, NPM Vet, REST, Express.js with MongoDB, and SQLite CRUD operations. This Node.js training focuses on the essential concepts of Node.js and provides hands-on experience in building an HTTP server.<br><br>Eligibility:<br>This Node.js Certification Training is ideal for technical project managers, technical leads, full-stack web developers, quality analysts, architects, and students or aspiring professionals who wish to lead web development.<br><br>ud83dudc49Learn more at: https://bit.ly/2W6kBXN
E N D
What’s in it for you? What is Express?
What’s in it for you? What is Express? Express JS Features
What’s in it for you? What is Express? Express JS Features DEMO
Express • Express is a flexible Node.js web application framework which provides a wide set of features to develop both web and mobile applications
Express • Express is a flexible Node.js web application framework which provides a wide set of features to develop both web and mobile applications • Express JS makes it much easier and simpler to build a web server with the use of middleware that can handle requests and responses
Let’s see some of the core features of Express framework: • It can be used to design single-page, multi-page and hybrid web applications
Let's see some of the core features of Express framework: • It can be used to design single-page, multi-page and hybrid web applications • It allows to setup middlewares to respond to HTTP requests
Let's see some of the core features of Express framework: • It can be used to design single-page, multi-page and hybrid web applications • It allows to setup middlewares to respond to HTTP requests • It defines a routing table which is used to perform different actions based on HTTP method and URL
Let's see some of the core features of Express framework: • It can be used to design single-page, multi-page and hybrid web applications • It allows to setup middlewares to respond to HTTP requests • It defines a routing table which is used to perform different actions based on HTTP method and URL • It allows to dynamically render HTML Pages based on passing arguments to templates
A basic Hello World example varexpress = require('express'); varapp = express(); app.get('/', function (req, res) { res.send('Hello World'); }) varserver = app.listen(8081, function () { varhost = server.address().address varport = server.address().port console.log("Example app listening at http://%s:%s", host, port) }) • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request Hello_world.js
A basic Hello World example Importing Express framework into our Node.js application varexpress = require('express'); varapp = express(); app.get('/', function (req, res) { res.send('Hello World'); }) varserver = app.listen(8081, function () { varhost = server.address().address varport = server.address().port console.log("Example app listening at http://%s:%s", host, port) }) • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request Hello_world.js
A basic Hello World example Callback function with parameters ‘request’ and ‘response’ varexpress = require('express'); varapp = express(); app.get('/', function (req, res) { res.send('Hello World'); }) varserver = app.listen(8081, function () { varhost = server.address().address varport = server.address().port console.log("Example app listening at http://%s:%s", host, port) }) • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request Hello_world.js
A basic Hello World example varexpress = require('express'); varapp = express(); app.get('/', function (req, res) { res.send(‘Hello World'); }) varserver = app.listen(8081, function () { varhost = server.address().address varport = server.address().port console.log("Example app listening at http://%s:%s", host, port) }) • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request Hello_world.js
A basic Hello World example varexpress = require('express'); varapp = express(); app.get('/', function (req, res) { res.send('Hello World'); }) varserver = app.listen(8081, function () { varhost = server.address().address varport = server.address().port console.log("Example app listening at http://%s:%s", host, port) }) • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request Application will listen on the defied port which in this case is “8081”, and variables ‘host’ and ‘port’ will contain the address and the port respectively Hello_world.js
A basic Hello World example varexpress = require('express'); varapp = express(); app.get('/', function (req, res) { res.send('Hello World'); }) varserver = app.listen(8081, function () { varhost = server.address().address varport = server.address().port console.log("Example app listening at http://%s:%s", host, port) }) • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request This snippet is to show the address and port in the command prompt or terminal Hello_world.js
A basic Hello World example Command prompt shows the address and port • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request
A basic Hello World example Hello World • The request object represents the HTTP request and has properties for the request query string, parameters, body, HTTP headers, and so on • The response object represents the HTTP response that an Express app sends when it gets an HTTP request Hello World is printed on the Web Server
DEMO DEMO