diff --git a/Notes/ExpressJS.txt b/Notes/ExpressJS.txt new file mode 100644 index 00000000..74edec6b --- /dev/null +++ b/Notes/ExpressJS.txt @@ -0,0 +1,393 @@ +================================================= + Express :- 31/02/2024 +================================================== + +===================================== +Library vs Framework :- +=========================================== + +------------ +Library :- +----------- + + A library is collectiomn of pre-written code that can be used to perform specific tasks. + +Ex: axois + +------------ +Framework :- +----------- + +A framework is a set of pre-written code that provides a stracture for developing software application. + +Ex: express + + +========================================= + Express :- +======================================== + +-> A Node.js web application framework that helps us to make web applications. + +-> it is used for server side programmig. + +------------- +used :- +------------- + +-> listen for incomming request + +-> parse the rquest + +-> to match respnose with routes. + +-> response send + + +-------------------------------------------- +Geeting Started with Express :- +----------------------------------------------- + +port :- + +it is used the logical endpoints of a network connection that is used to exchange information b/w a web server and a web client. + + +------------------------------------- +Sending a response +----------------------------------------------- + +1) request + + Ex :- // reequest send to server + + + app.use((req,res)=>{ + + console.log("request receive"); + }) + + + + + +2) response + + + app.use((req,res)=>{ + + console.log("request receive"); + + let cod="
+
+ + Sindre Sorhus' open source work is supported by the community on GitHub Sponsors and Dev + +
+ Special thanks to: +