L26 - NodeJS 2
L26 - NodeJS 2
L26 - NodeJS 2
COS216
AVINASH SINGH
DEPARTMENT OF COMPUTER SCIENCE
UNIVERSITY OF PRETORIA
NodeJS – Web App Architecture
Client Layer
Server Layer
Business Layer
Data Layer
NodeJS – Web App Architecture
NodeJS – Create a server
Example:
response.writeHead(404, {'Content-Type': 'text/html’});
NodeJS – Create a server
body-parser − This is a node.js middleware for handling JSON, Raw, Text and URL encoded form data.
cookie-parser − Parse Cookie header and populate req.cookies with an object keyed by the cookie names.
multer − This is a node.js middleware for handling multipart/form-data.
NodeJS – Express Framework