WT Unit-3 Express Js
WT Unit-3 Express Js
(2101CS304)
Unit-03
ExpressJS
ExpressJS
Serving Static Resources
Database Connectivity
API Using NodeJS
ExpressJS
Express js is a very popular web application framework built to create Node.js Web based
applications.
It provides an integrated environment to facilitate rapid development of Node based Web
applications.
Express framework is based on Connect middleware engine and used Jade html template
framework for HTML templating.
Core features of Express framework:
Allows to set up middlewares to respond to HTTP Requests.
Defines a routing table which is used to perform different action based on HTTP method and URL.
Allows to dynamically render HTML Pages based on passing arguments to templates.
Installing Express
npm install express
This route path will match butterfly and dragonfly, but not butterflyman, dragonflyman, and
so on.
1 app.get(/*fly$/, function(req, res) {
2 res.send('/*fly$/');
3 });