How to Setup Routes with Express Router | Node.js & Express tutorials for Beginners

Dave Gray
Dave Gray
39.1 هزار بار بازدید - 3 سال پیش - Web Dev Roadmap for Beginners
Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap Learn how to setup routes with Express Router in this Node.js & Express tutorial for beginners. An Express JS app gets unorganized if you build it all in one file. Setup routes with Express Router to handle each route in its own file and organize your project. 🚩 Subscribe ➜ bit.ly/3nGHmNn 🚀 This lesson is part of an Node.js & Express for Beginners tutorial series playlist:    • Node.js Tutorials for Beginners   🔗 Starter Source Code: github.com/gitdagray/express_middleware How to Setup Routes with Express Router | Node.js & Express tutorials for Beginners (00:00) Intro (00:05) Welcome (00:15) Intro and Setup (00:34) Creating a router (04:36) Applying the router (06:30) Applying static files to the routes (08:16) Correction concerning app.use() (09:25) Creating a second router (12:28) Creating a REST API router (16:23) Multiple http methods per route and parameter values (19:51) Named parameter routes (21:25) Testing the API routes (24:26) Challenge - API route handlers 📚 References: Node.js Official site: nodejs.org/ NPM Official site: www.npmjs.com/ Express JS Official site: expressjs.com/ MDN CORS: developer.mozilla.org/en-US/docs/Web/HTTP/CORS NPM CORS: www.npmjs.com/package/cors ✅ Follow Me: Twitter: twitter.com/yesdavidgray LinkedIn: www.linkedin.com/in/davidagray/ Blog: yesdavidgray.com/ Reddit: www.reddit.com/user/DaveOnEleven Was this tutorial about how to set up routes and use the router in Express JS helpful? If so, please share. Let me know your thoughts in the comments. #express #router #routes
3 سال پیش در تاریخ 1400/06/30 منتشر شده است.
39,126 بـار بازدید شده
... بیشتر