Skip to playerSkip to main content
  • 2 days ago
🌍 Planning to travel, study, or find a place to stay?
At Mava, we support you every step of the way ✨
🎓 University applications
🏡 Housing & rental services
✈️ Travel bookings & tour packages
Free consultation | Full support | Options that fit you
📲 Contact us on WhatsApp: +905073410436
Or connect on mava with BasemHalaika
Mava company
in the bio

🌍 Seyahat, eğitim veya konaklama mı planlıyorsunuz?
Mava olarak her adımda yanınızdayız ✨
🎓 Üniversite başvuruları
🏡 Konaklama ve kiralama hizmetleri
✈️ Uçuş ve tur programları
Ücretsiz danışmanlık | Tam destek | Size uygun seçenekler
📲 WhatsApp: +905073410436
Ya da mava'da BasemHalaika
Mava şirketi
biode

🌍 هل تخطط للسفر أو الدراسة أو تبحث عن سكن مناسب؟
في Mava نحن معك في كل خطوة ✨
🎓 التقديم على الجامعات
🏡 خدمات السكن والإيجار
✈️ حجوزات الطيران والبرامج السياحية
استشارة مجانية | دعم كامل | خيارات تناسبك
📲 تواصل معنا عبر واتساب: +905073410436
او تواصل على mava مع BasemHalaika
Mava شركة
in the bio

Category

🤖
Tech
Transcript
00:00hello everyone and welcome back in the previous video we created our first node.js project
00:06installed xepress and start our first server today we are going to understand what xepress
00:13really is and learn how to create different routes using get post post and the it requests
00:21by the end of this video you will know how the xepress handles requests and how to send
00:27response back to the client so let's get started let's open the project we created in the previous
00:34lesson inside visual studio coin inside our project we already have a file called index.gl
00:46and we created const xepress const app or router app.get and app.person now what's the router
00:57a router is a simple url that you serve a listing tool when a client sends a request to the
01:05url
01:06xepress executes the function you provide think of your backend like a restaurant
01:12a customer replaces an order a kitchen prepares the food then the water brings it back in the backend
01:21the client sends the client sends the client sends a request the server processes it then sends a response
01:27every request starts with a router
01:32in the previous video we creating a router send hello world now we will create another router in the gate
01:43for example for example update get about update get contact and now each url retains different data
01:55xepress it checks the request url and runs the matching router it is that simple we will try we will
02:06save
02:08save and we will try noob and the exit to us and running is a server server is running on
02:20port 3000
02:23we will type
02:26for example about
02:31local
02:35localhost
02:37localhost 3000 and slash about
02:48slash about and he give me about page like this about page slash about about page slash hello world
03:02like this
03:07hello world
03:09and
03:11slash contact
03:13he will give me contact page
03:21slash contact contact page give me
03:25update post now let's talk about post requests
03:29get requests
03:30get requests are usually used to retrieve data
03:32post requests are used to get a new data
03:36image
03:37a registration form when a user click sign up
03:41the front end sends a post requests to the backend
03:45let's create one of update posts
03:49like this update post users
03:52let's send user created successfully
03:55science the browser is usually send get requests
03:58will test post request using postman open postman
04:02reclose a post enter
04:05http local post in 3000 users
04:09fixin you will receive
04:12a user created successfully
04:16okay
04:17now we will learn app.pot
04:19what's the app.pot
04:22bot is used to update exactly data
04:25image
04:26a user wants to change their username
04:28the front end sends a post request
04:30let's create one
04:32like this
04:33update what users
04:34let's do send user updated successfully
04:38i can test it using postman
04:40everything works exactly
04:42the same expect the http method is deployed
04:47up to delete
04:48we learn now up to delete
04:51delete is used to remove data
04:53for example
04:54deleting user account
04:56let's create the router
04:58that will delete users
05:00restart send user deleted successfully
05:04and test it in postman using the delete user
05:09perfect
05:10now you have learned that for http method
05:13you will use a lot every day
05:17we learn app.get
05:19restart send hello
05:20and we learn about
05:23dot posts
05:25app.t posts
05:28and we learn app.pot
05:30and we learn app.ding
05:34we learn many more later
05:36but we will learn many more later
05:39but these four are the most important
05:42sending responses
05:44so far we have been using
05:46restart send
05:47this sends a response back to the client
05:49that the response can be many different types
05:53for example
05:55texts
05:56i would get restart send hello world
05:59this is text
06:01and we can send object like this
06:04restart send name
06:15this is
06:18when building api star
06:21the most common response format is chosen
06:24instead of using send
06:26express also
06:29restitution
06:30success to message user created like this
06:33and in the in the in the node.js we can send
06:37a send
06:38just like this
06:39restitution success to message user created
06:43this is
06:44solution we can send
06:46listen
06:50this is automatically send
06:51listen data
06:52you will use restitution in almost every api
06:55we built during this courses
06:58quickly see
06:59this is equivalently what we have learned today
07:02except this is a firmware
07:04that make back in the room
07:06but much easier
07:08we learned how to create router
07:11we
07:12we learned that every router responds to a specific activity
07:15method
07:16get directory data
07:18put creates data
07:20put updates data
07:21delete removes data
07:23data
07:23we also learned how to send response using restitution
07:27and restitution
07:28these are the building
07:29glows of every
07:31exhibited
07:31application
07:32what's next
07:33in the next video
07:34we are going to
07:36departing to http requests
07:38we all understand the requests object in detail
07:42we learn about others requests
07:44for the
07:44inquiry
07:45parameters
07:47graphs
07:48parameters
07:48restitues
07:49codes
07:50and much more
07:52these concepts are essential
07:54because every backend developer
07:56works with them
07:58every single day
07:59so make sure you understand
08:01today's listeners
08:02before we go
08:03goodbye
08:04thank you so much for watching
08:06if you enjoyed this video
08:08don't forget to like the video
08:10subscribe to the channel
08:12and i will see you in the next episode
08:14goodbye
Comments

Recommended