64-Express JS-Introduction-Service GET-POST-Router-Request and Response Object Properties and Methods.p-09-03-2023
64-Express JS-Introduction-Service GET-POST-Router-Request and Response Object Properties and Methods.p-09-03-2023
Express JS
Node.js is an amazing tool for building networking services and
applications.
Express is a Node.js Web Framework. ExpressJS is a web application
framework that provides you with a simple API to build websites, web
apps and back ends.
It is flexible as there are numerous modules available on npm, which
can be directly plugged into Express.
Express was developed by TJ Holowaychuk and is maintained by
the Node.js foundation and numerous open source contributors.
Express is a minimal and flexible Node.js web application framework
that provides a robust set of features for web and mobile applications. It
is an open source framework developed and maintained by the Node.js
foundation.
The app.use function call on route '/things' attaches the things router
with this route.
Now whatever requests our app gets at the '/things', will be handled by
our things.js router.
The '/' route in things.js is actually a subroute of '/things'. Visit
localhost:3000/things/
R Vijayan / Asso Prof / SITE / VIT
Express.js Request Object - req
The express.js request object represents the HTTP request
and has properties for the request query string, parameters,
body, HTTP headers, and so on.
app.get('/', function (req, res) {
// --
})