title
Express JS Crash Course
description
In this crash course we will dive into the Express JS framework for Node.js. I recommend first watching my Node.js crash course.
Sponsor: Freelancer Bundle (Use "brad25" for 25% off)
https://studywebdevelopment.com/freelancing.html
Code:
https://github.com/bradtraversy/express_crash_course
💖 Become a Patron: Show support & get perks!
http://www.patreon.com/traversymedia
Node/Express/Mongo Udemy Course:
https://www.udemy.com/nodejs-express-mongodb-dev-to-deployment/?couponCode=
Node Crash Course:
https://www.youtube.com/watch?v=fBNz5xF-Kx4
Passport Authentication:
https://www.youtube.com/watch?v=6FOq4cUdH8k
Website & Udemy Courses
http://www.traversymedia.com
Follow Traversy Media:
https://www.facebook.com/traversymedia
https://www.twitter.com/traversymedia
https://www.instagram.com/traversymedia
detail
{'title': 'Express JS Crash Course', 'heatmap': [{'end': 1423.395, 'start': 1375.735, 'weight': 1}], 'summary': 'Provides a comprehensive express crash course covering its features, use cases, and advantages, including setting up a server in vs code, creating routes and middleware functions, managing http statuses, api creation, member management, and template rendering with bootstrap integration, demonstrating examples with mongodb, postgres, mongoose, sequelize, and handlebars.', 'chapters': [{'end': 347.258, 'segs': [{'end': 60.949, 'src': 'embed', 'start': 29.209, 'weight': 0, 'content': [{'end': 31.09, 'text': 'Welcome to my Express crash course.', 'start': 29.209, 'duration': 1.881}, {'end': 34.872, 'text': 'So a couple of weeks ago, I did a 90 minute crash course on Node.js.', 'start': 31.13, 'duration': 3.742}, {'end': 40.076, 'text': 'And this is the next step, seeing that Express is the most popular web framework for Node.', 'start': 35.393, 'duration': 4.683}, {'end': 43.898, 'text': "And even if you've worked with Express before, I'd still encourage you to watch,", 'start': 40.676, 'duration': 3.222}, {'end': 47.181, 'text': "because you'll most likely learn something new somewhere along the way.", 'start': 43.898, 'duration': 3.283}, {'end': 52.984, 'text': "So we're going to quickly look at some slides and then we'll jump in and we'll start to look at how Express works.", 'start': 47.661, 'duration': 5.323}, {'end': 56.226, 'text': "So let's first talk about what Express is.", 'start': 54.145, 'duration': 2.081}, {'end': 60.949, 'text': "It's a very fast, unopinionated and minimalist web framework.", 'start': 56.307, 'duration': 4.642}], 'summary': 'Express crash course covering key points and benefits of the popular web framework.', 'duration': 31.74, 'max_score': 29.209, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE29209.jpg'}, {'end': 178.597, 'src': 'embed', 'start': 133.935, 'weight': 1, 'content': [{'end': 138.698, 'text': "so there's a lot of different options when it comes to building web apps using express.", 'start': 133.935, 'duration': 4.763}, {'end': 141.76, 'text': "So let's look at why we would use Express.", 'start': 139.719, 'duration': 2.041}, {'end': 146.421, 'text': 'Well, for one thing, it makes building Node web apps about 100 times easier.', 'start': 142.26, 'duration': 4.161}, {'end': 154.704, 'text': 'If you watch my Node crash course and you built out the simple web server, there was quite a bit of code there to do something very, very simple.', 'start': 146.781, 'duration': 7.923}, {'end': 159.186, 'text': 'We had to manually grab the URL, load the file, check the content type.', 'start': 154.744, 'duration': 4.442}, {'end': 160.426, 'text': 'It was very tedious.', 'start': 159.426, 'duration': 1}, {'end': 165.248, 'text': "Express makes handling requests very simple, and it's much, much less code.", 'start': 160.526, 'duration': 4.722}, {'end': 174.154, 'text': 'So like I said, Express is used for both APIs that serve JSON data as well as back end applications that render pages on the server.', 'start': 165.948, 'duration': 8.206}, {'end': 177.016, 'text': "OK, it's like I said, it's extremely fast.", 'start': 174.174, 'duration': 2.842}, {'end': 178.597, 'text': 'It gives you a ton of freedom.', 'start': 177.116, 'duration': 1.481}], 'summary': 'Express simplifies building web apps, making it 100 times easier, faster, and requires less code.', 'duration': 44.662, 'max_score': 133.935, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE133935.jpg'}, {'end': 237.522, 'src': 'embed', 'start': 204.722, 'weight': 4, 'content': [{'end': 207.423, 'text': "and it's a much larger framework.", 'start': 204.722, 'duration': 2.701}, {'end': 213.205, 'text': "so the next advantage is, is true, for just node itself, and that's that it's it's javascript.", 'start': 207.423, 'duration': 5.782}, {'end': 219.871, 'text': "so if you're building full stack app with like React, you're still using JavaScript on the server side.", 'start': 213.205, 'duration': 6.666}, {'end': 222.014, 'text': "So there's no need for multiple languages.", 'start': 219.931, 'duration': 2.083}, {'end': 223.856, 'text': "So that's always an advantage.", 'start': 222.074, 'duration': 1.782}, {'end': 225.638, 'text': "But that's not just for Express.", 'start': 224.196, 'duration': 1.442}, {'end': 228.742, 'text': "That's anything that has to do with Node.", 'start': 225.658, 'duration': 3.084}, {'end': 237.522, 'text': 'So as far as what you should know before starting to learn express I would say at the very least you should just be comfortable with JavaScript.', 'start': 230.396, 'duration': 7.126}], 'summary': 'Node.js allows full stack development with javascript, eliminating the need for multiple languages, and comfort with javascript is essential for learning express.', 'duration': 32.8, 'max_score': 204.722, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE204722.jpg'}], 'start': 7.165, 'title': 'Express framework', 'summary': 'Introduces the express crash course, highlighting its features, use cases, and advantages, including its role as a server-side framework for building web apps and its simplification of handling requests compared to traditional node.js web servers. it also discusses the popularity of the express framework, its advantages over other node frameworks, and the prerequisite knowledge needed to learn express.', 'chapters': [{'end': 178.597, 'start': 7.165, 'title': 'Express crash course', 'summary': 'Introduces the express crash course, highlighting its features, use cases, and advantages, including its role as a server-side framework for building web apps, its unopinionated and minimalist nature, and its simplification of handling requests compared to traditional node.js web servers.', 'duration': 171.432, 'highlights': ['Express is a fast, unopinionated, and minimalist web framework, making handling requests simpler and reducing code by about 100 times compared to traditional Node.js web servers.', 'It is used for building APIs that serve JSON data and backend applications that render pages on the server, providing a ton of freedom and high performance.', 'It is not comparable to client-side frameworks like React or Angular, often used in combination with these frameworks to build powerful full-stack web apps.']}, {'end': 347.258, 'start': 179.038, 'title': 'Express framework overview', 'summary': 'Discusses the popularity of the express framework, its advantages over other node frameworks, and the prerequisite knowledge needed to learn express, emphasizing the importance of understanding javascript, node, npm, http, and essential web server syntax.', 'duration': 168.22, 'highlights': ['Express is the most popular framework, with examples like Koa, HappyJS, and Adonis falling behind in popularity. Express is the most popular framework, overshadowing other node frameworks like Koa, HappyJS, and Adonis.', 'Adonis is compared to Laravel for PHP, providing higher-level functionalities and more features, but with less freedom and a larger framework size. Adonis is similar to Laravel for PHP, offering more features but less freedom and a larger framework size.', 'The advantage of using JavaScript for full-stack app development with React eliminates the need for multiple languages, applicable to anything related to Node. Using JavaScript for full-stack app development with React eliminates the need for multiple languages, a benefit applicable to all Node-related projects.', 'Prerequisite knowledge for learning Express includes comfort with JavaScript, basic knowledge of Node and NPM, understanding HTTP and status codes, and familiarity with core modules and newer JavaScript features. The prerequisite knowledge for learning Express includes comfort with JavaScript, basic knowledge of Node and NPM, understanding HTTP and status codes, and familiarity with core modules and newer JavaScript features.', 'The basic syntax of a web server using Express involves initializing Express, creating endpoints, and listening on a specific port. The basic syntax of a web server using Express involves initializing Express, creating endpoints, and listening on a specific port.']}], 'duration': 340.093, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE7165.jpg', 'highlights': ['Express is a fast, unopinionated, and minimalist web framework, making handling requests simpler and reducing code by about 100 times compared to traditional Node.js web servers.', 'It is used for building APIs that serve JSON data and backend applications that render pages on the server, providing a ton of freedom and high performance.', 'Express is the most popular framework, with examples like Koa, HappyJS, and Adonis falling behind in popularity.', 'Adonis is compared to Laravel for PHP, providing higher-level functionalities and more features, but with less freedom and a larger framework size.', 'Prerequisite knowledge for learning Express includes comfort with JavaScript, basic knowledge of Node and NPM, understanding HTTP and status codes, and familiarity with core modules and newer JavaScript features.']}, {'end': 972.255, 'segs': [{'end': 442.895, 'src': 'embed', 'start': 418.256, 'weight': 1, 'content': [{'end': 424.439, 'text': 'Do you want to render a template? So you can do multiple things with this response object.', 'start': 418.256, 'duration': 6.183}, {'end': 427.321, 'text': 'If you want to redirect, you can do res.redirect.', 'start': 424.499, 'duration': 2.822}, {'end': 433.645, 'text': "So we're going to look at more in depth into both of these objects as the course goes on.", 'start': 427.721, 'duration': 5.924}, {'end': 438.911, 'text': "and then we can parse any incoming data with the body parser that's included with Express.", 'start': 434.085, 'duration': 4.826}, {'end': 442.895, 'text': "Also, we don't have to put all of our routes in one file.", 'start': 439.952, 'duration': 2.943}], 'summary': 'Express allows rendering templates, redirecting, parsing data and organizing routes separately.', 'duration': 24.639, 'max_score': 418.256, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE418256.jpg'}, {'end': 521.21, 'src': 'embed', 'start': 495.758, 'weight': 0, 'content': [{'end': 502.06, 'text': 'So you can just think of it as kind of a stack of functions that executes whenever a request is made to the server.', 'start': 495.758, 'duration': 6.302}, {'end': 504.421, 'text': 'And you can do different things within those functions.', 'start': 502.16, 'duration': 2.261}, {'end': 506.142, 'text': "That's the gist of it.", 'start': 505.301, 'duration': 0.841}, {'end': 507.022, 'text': 'All right.', 'start': 506.762, 'duration': 0.26}, {'end': 508.222, 'text': 'So enough talk.', 'start': 507.202, 'duration': 1.02}, {'end': 508.883, 'text': "Let's jump in.", 'start': 508.262, 'duration': 0.621}, {'end': 512.924, 'text': "It's much easier to see examples rather than me try to explain it.", 'start': 508.923, 'duration': 4.001}, {'end': 514.025, 'text': "So we're going to jump in.", 'start': 513.063, 'duration': 0.962}, {'end': 518.447, 'text': "We're going to look at pretty much all the fundamentals of the express framework.", 'start': 514.044, 'duration': 4.403}, {'end': 521.21, 'text': 'All right guys, couple things before we get started.', 'start': 519.168, 'duration': 2.042}], 'summary': 'Introduction to express framework for server requests and functions.', 'duration': 25.452, 'max_score': 495.758, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE495758.jpg'}, {'end': 552.887, 'src': 'embed', 'start': 529.356, 'weight': 2, 'content': [{'end': 540.182, 'text': 'Now this is the express website expressjs.com which has pretty good documentation has some guides We are using version 4.16.4 in this crash course.', 'start': 529.356, 'duration': 10.826}, {'end': 543.523, 'text': 'However, version 5 is in alpha at the moment.', 'start': 540.522, 'duration': 3.001}, {'end': 551.786, 'text': "If version 5 is stable by the time you watch this, you should still be all right, because most of the syntax, everything that's on the surface,", 'start': 544.504, 'duration': 7.282}, {'end': 552.887, 'text': 'is pretty much the same.', 'start': 551.786, 'duration': 1.101}], 'summary': 'Express website (expressjs.com) has good documentation and guides. using version 4.16.4 in this crash course, while version 5 is in alpha.', 'duration': 23.531, 'max_score': 529.356, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE529356.jpg'}, {'end': 619.697, 'src': 'embed', 'start': 576.281, 'weight': 4, 'content': [{'end': 579.523, 'text': "Okay, so I'm going to jump into VS Code, which is the text editor I'm using.", 'start': 576.281, 'duration': 3.242}, {'end': 581.644, 'text': 'Of course, you can use any text editor you want.', 'start': 579.563, 'duration': 2.081}, {'end': 588.209, 'text': "I'll be using the integrated terminal as well as far as installing packages and stuff like that.", 'start': 582.465, 'duration': 5.744}, {'end': 594.174, 'text': 'I just have an empty folder called Express Crash Course.', 'start': 589.21, 'duration': 4.964}, {'end': 597.257, 'text': "First thing we're going to do is create a package.json.", 'start': 594.234, 'duration': 3.023}, {'end': 603.243, 'text': "I'm going to do npm init and I'm just going to add on the dash y flag so that I don't have to answer any questions.", 'start': 597.417, 'duration': 5.826}, {'end': 607.186, 'text': 'You can see that that creates a package.json file.', 'start': 604.424, 'duration': 2.762}, {'end': 610.85, 'text': "Now we're going to want to install express.", 'start': 608.007, 'duration': 2.843}, {'end': 613.712, 'text': "There's a couple of things that I'm going to install throughout this course.", 'start': 610.95, 'duration': 2.762}, {'end': 615.694, 'text': "But right now, I'm just going to install express.", 'start': 613.752, 'duration': 1.942}, {'end': 619.697, 'text': "I'm going to say NPM install or I express.", 'start': 615.714, 'duration': 3.983}], 'summary': 'Using vs code, setting up express project, and installing express using npm.', 'duration': 43.416, 'max_score': 576.281, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE576281.jpg'}, {'end': 951.073, 'src': 'embed', 'start': 922.957, 'weight': 3, 'content': [{'end': 927.921, 'text': 'One is going to be start, which is just simply going to run node index start.', 'start': 922.957, 'duration': 4.964}, {'end': 931.443, 'text': 'So that will most likely be used in deployment.', 'start': 929.122, 'duration': 2.321}, {'end': 935.105, 'text': "And then for dev, I'm going to create a script called dev.", 'start': 931.783, 'duration': 3.322}, {'end': 938.126, 'text': "And we're going to use node mon index.", 'start': 935.725, 'duration': 2.401}, {'end': 942.368, 'text': "And the difference is node index, you'll have to keep resetting the server.", 'start': 938.827, 'duration': 3.541}, {'end': 946.05, 'text': 'Every time you make a change, node mon will constantly watch it.', 'start': 942.568, 'duration': 3.482}, {'end': 947.651, 'text': "So we'll save this.", 'start': 946.69, 'duration': 0.961}, {'end': 951.073, 'text': "And then let's go down here and run npm run dev.", 'start': 947.851, 'duration': 3.222}], 'summary': 'Two scripts created for deployment and development, using node and node mon, respectively.', 'duration': 28.116, 'max_score': 922.957, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE922957.jpg'}], 'start': 347.258, 'title': 'Express framework fundamentals and setting up express server in vs code', 'summary': 'Covers the fundamentals of the express framework, including use of mongodb and postgres with node, creating routes and middleware functions, and setting up an express server in vs code with guidance on using node.js, express version 4.16.4, and postman http client. it also includes creating package.json, installing express, handling routes, and using nodemon for server auto-reloading.', 'chapters': [{'end': 575.52, 'start': 347.258, 'title': 'Express framework fundamentals', 'summary': 'Covers the fundamentals of the express framework, including the use of mongodb and postgres with node, creating routes and middleware functions, as well as the importance of request and response objects, with guidance on using node.js, express version 4.16.4, and the postman http client.', 'duration': 228.262, 'highlights': ['The chapter covers the fundamentals of the Express framework, including the use of MongoDB and Postgres with Node. Discusses the versatility of using MongoDB and also mentions the option to use Postgres with Node.', 'Creating routes and middleware functions is an integral part of the Express framework. Emphasizes the importance of creating routes and middleware functions, essential components of the Express framework.', 'Understanding the request and response objects is crucial, with the ability to manipulate and utilize them for various tasks. Stresses the significance of the request and response objects, highlighting their manipulation for tasks such as fetching data from a database and rendering templates.', 'Guidance on using Node.js, Express version 4.16.4, and the Postman HTTP client is provided. Provides guidance on using Node.js, specifically Express version 4.16.4, and the Postman HTTP client for making requests to the server.']}, {'end': 972.255, 'start': 576.281, 'title': 'Setting up express server in vs code', 'summary': 'Covers setting up an express server in vs code, including creating a package.json, installing express, creating an index.js file, setting up a simple express server, handling routes, and using nodemon for server auto-reloading.', 'duration': 395.974, 'highlights': ['Using nodemon for server auto-reloading Nodemon is installed to enable constant server watching without the need to reload, enhancing development efficiency.', 'Setting up a simple express server and handling routes The process involves creating an index.js file, initializing an express server, handling routes using app.get, and sending responses to the browser.', 'Creating a package.json and installing express The chapter demonstrates creating a package.json using npm init with the -y flag and installing express using npm install express.']}], 'duration': 624.997, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE347258.jpg', 'highlights': ['Covers fundamentals of Express framework, including MongoDB and Postgres with Node.', 'Creating routes and middleware functions is integral to the Express framework.', 'Guidance on using Node.js, Express version 4.16.4, and Postman HTTP client provided.', 'Using nodemon for server auto-reloading enhances development efficiency.', 'Setting up a simple express server involves creating an index.js file and handling routes.', 'Demonstrates creating a package.json using npm init with the -y flag and installing express.']}, {'end': 1496.665, 'segs': [{'end': 1000.008, 'src': 'embed', 'start': 974.048, 'weight': 0, 'content': [{'end': 978.652, 'text': 'Now, as far as what we send as a response, we have a bunch of different options.', 'start': 974.048, 'duration': 4.604}, {'end': 982.655, 'text': "Obviously, we have send, but that's not used too much.", 'start': 979.132, 'duration': 3.523}, {'end': 986.297, 'text': 'We could send a file, a single file, if we want.', 'start': 983.595, 'duration': 2.702}, {'end': 987.378, 'text': "I'll show you how to do that.", 'start': 986.357, 'duration': 1.021}, {'end': 990.861, 'text': 'We could send JSON with res.json.', 'start': 987.478, 'duration': 3.383}, {'end': 993.303, 'text': 'We could do res.render.', 'start': 991.822, 'duration': 1.481}, {'end': 1000.008, 'text': 'If we had a template engine, we could actually render an HTML template where we could actually put variables in and stuff like that.', 'start': 993.343, 'duration': 6.665}], 'summary': 'Options for sending a response include sending a file, json, or rendering html with variables.', 'duration': 25.96, 'max_score': 974.048, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE974048.jpg'}, {'end': 1274.502, 'src': 'embed', 'start': 1243.019, 'weight': 1, 'content': [{'end': 1246.162, 'text': 'basically this is what we did, and we wrote a whole lot of code.', 'start': 1243.019, 'duration': 3.143}, {'end': 1249.284, 'text': 'to be able to do it, we had to handle the content type ourselves.', 'start': 1246.162, 'duration': 3.122}, {'end': 1258.231, 'text': 'we had to handle um, loading the html files, loading the css, any images, stuff like that with express.', 'start': 1249.284, 'duration': 8.947}, {'end': 1265.256, 'text': "when we, when we deal with this static folder, we don't have to do anything except just put the files in here and it will just work.", 'start': 1258.231, 'duration': 7.025}, {'end': 1274.502, 'text': "and all we have to do is write this, these few lines of code okay, So that's how we can create a static server that just serves, you know,", 'start': 1265.256, 'duration': 9.246}], 'summary': 'Created a static server to handle content types and files with express, requiring minimal code.', 'duration': 31.483, 'max_score': 1243.019, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1243019.jpg'}, {'end': 1423.395, 'src': 'heatmap', 'start': 1375.735, 'weight': 1, 'content': [{'end': 1381.258, 'text': 'OK, if we want to return Jason, we just do res dot Jason and we can simply just put in members.', 'start': 1375.735, 'duration': 5.523}, {'end': 1389.363, 'text': "OK, now we don't even have to do like Jason string of fire or anything, even though these are JavaScript objects, because this will take care of it.", 'start': 1381.278, 'duration': 8.085}, {'end': 1395.708, 'text': "OK, so let's go ahead and save that and then I'm going to open up Postman.", 'start': 1390.043, 'duration': 5.665}, {'end': 1406.076, 'text': "make sure this is a get request and let's say HTTP local host port 5000 slash API slash members.", 'start': 1395.708, 'duration': 10.368}, {'end': 1407.237, 'text': 'And there we go.', 'start': 1406.656, 'duration': 0.581}, {'end': 1408.718, 'text': 'So we get our three members.', 'start': 1407.297, 'duration': 1.421}, {'end': 1411.48, 'text': "OK, so it's as simple as that.", 'start': 1409.719, 'duration': 1.761}, {'end': 1423.395, 'text': "Now, since this is only one expression here and we're using an arrow function, I don't even need to To use curly braces, we can just go like that.", 'start': 1411.5, 'duration': 11.895}], 'summary': 'Returning jason using res.jason with members, making a get request returns 3 members.', 'duration': 47.66, 'max_score': 1375.735, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1375735.jpg'}], 'start': 974.048, 'title': 'Web response options and creating a static server with express', 'summary': 'Covers various response options in web development, including json usage and template engines, as well as creating a static server with express to serve html, css, images, and develop a simple rest api for fetching member data.', 'chapters': [{'end': 1011.956, 'start': 974.048, 'title': 'Web response options', 'summary': 'Discusses various options for sending responses in web development, including sending files, using json with res.json, and rendering html templates with template engines like pug, handlebars, or pjs.', 'duration': 37.908, 'highlights': ['Various response options include sending files, using JSON with res.json, and rendering HTML templates with template engines like PUG, handlebars, or pjs.', 'Handlebars and pjs are preferred template engines for rendering templates on the server.', 'The chapter discusses different options for sending responses, such as sending files, using JSON with res.json, and rendering HTML templates with template engines like PUG.']}, {'end': 1496.665, 'start': 1011.956, 'title': 'Creating a static server with express', 'summary': 'Explains how to create a static server using express, enabling the serving of html, css, and images, and then proceeds to demonstrate the creation of a simple rest api to fetch member data.', 'duration': 484.709, 'highlights': ["The chapter explains how to create a static server using Express, enabling the serving of HTML, CSS, and images. Demonstrates the use of Express to serve static files, eliminating the need to manually define routes for each file. Shows the ease of setting a folder as a static folder using 'express.static' method.", "The demonstration includes creating a simple REST API to fetch member data. Illustrates the creation of a route using 'app.get' to serve JSON data. Shows the usage of 'res.json' method to send JSON response without the need for JSON stringification."]}], 'duration': 522.617, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE974048.jpg', 'highlights': ['Handlebars and pjs are preferred template engines for rendering templates on the server.', 'The chapter explains how to create a static server using Express, enabling the serving of HTML, CSS, and images.', 'Various response options include sending files, using JSON with res.json, and rendering HTML templates with template engines like PUG.']}, {'end': 2145.246, 'segs': [{'end': 1526.902, 'src': 'embed', 'start': 1496.665, 'weight': 0, 'content': [{'end': 1505.147, 'text': "I'm sorry, I want to do require and And let's do dot slash members.", 'start': 1496.665, 'duration': 8.482}, {'end': 1507.189, 'text': 'Okay, so that should still work.', 'start': 1505.167, 'duration': 2.022}, {'end': 1508.49, 'text': "Let's test it out real quick.", 'start': 1507.209, 'duration': 1.281}, {'end': 1510.251, 'text': 'And it still works.', 'start': 1509.43, 'duration': 0.821}, {'end': 1516.495, 'text': "Okay, so as I was saying, I'm going to create just a simple middleware function.", 'start': 1510.851, 'duration': 5.644}, {'end': 1521.658, 'text': "So let's go right here and let's say const.", 'start': 1517.095, 'duration': 4.563}, {'end': 1525.28, 'text': "I'm going to use an arrow function, but you could use a regular function.", 'start': 1521.778, 'duration': 3.502}, {'end': 1526.902, 'text': "I'm going to call this logger.", 'start': 1525.661, 'duration': 1.241}], 'summary': 'Creating a simple middleware function named logger.', 'duration': 30.237, 'max_score': 1496.665, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1496665.jpg'}, {'end': 1586.487, 'src': 'embed', 'start': 1552.805, 'weight': 7, 'content': [{'end': 1558.008, 'text': 'OK, now, in order to initialize your middleware, actually, I need to do next.', 'start': 1552.805, 'duration': 5.203}, {'end': 1566.133, 'text': "Like I just said, in order to initialize it, we do app dot use and we're just going to pass in logger.", 'start': 1558.108, 'duration': 8.025}, {'end': 1571.877, 'text': "OK, let's say init middleware.", 'start': 1566.153, 'duration': 5.724}, {'end': 1579.922, 'text': "So now if I go and I hit actually going to go back, I'm going to go to postman.", 'start': 1572.998, 'duration': 6.924}, {'end': 1586.487, 'text': "And just make a request and then go back and look in the console and you'll see hello.", 'start': 1582.185, 'duration': 4.302}], 'summary': "Initializing middleware using app.use to pass in logger, resulting in 'hello' in console.", 'duration': 33.682, 'max_score': 1552.805, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1552805.jpg'}, {'end': 1676.887, 'src': 'embed', 'start': 1636.4, 'weight': 1, 'content': [{'end': 1645.022, 'text': "host We can get different parts of the URL and then we want the what's called the original URL which is the page.", 'start': 1636.4, 'duration': 8.622}, {'end': 1655.265, 'text': "So after that let's do request dot original URL.", 'start': 1645.682, 'duration': 9.583}, {'end': 1656.165, 'text': 'All right.', 'start': 1655.905, 'duration': 0.26}, {'end': 1663.367, 'text': "So let's just see what this gives us if we save this and then we go back to postman send a request and look in the console.", 'start': 1656.205, 'duration': 7.162}, {'end': 1666.719, 'text': 'It gives us undefined.', 'start': 1665.194, 'duration': 1.525}, {'end': 1669.146, 'text': "That's because I did res.", 'start': 1666.739, 'duration': 2.407}, {'end': 1672.034, 'text': 'I want request.', 'start': 1669.166, 'duration': 2.868}, {'end': 1676.887, 'text': 'And yeah, it should work.', 'start': 1674.404, 'duration': 2.483}], 'summary': "The code is corrected to retrieve the original url, resolving the issue of receiving 'undefined' in the console.", 'duration': 40.487, 'max_score': 1636.4, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1636400.jpg'}, {'end': 1767.404, 'src': 'embed', 'start': 1737.908, 'weight': 3, 'content': [{'end': 1741.733, 'text': 'And I have Prettier installed, so it just kind of formatted this a little bit.', 'start': 1737.908, 'duration': 3.825}, {'end': 1749.407, 'text': 'And if I go back and we make another request and we go and look in our console, now we have the URL and the date.', 'start': 1742.561, 'duration': 6.846}, {'end': 1755.613, 'text': 'OK So we could go further and we could save this to a file with the FS module if we wanted to.', 'start': 1750.088, 'duration': 5.525}, {'end': 1763.58, 'text': 'My point is you can do anything you want in terms of middleware and you have access to these request and response objects.', 'start': 1756.454, 'duration': 7.126}, {'end': 1767.404, 'text': "This is not something that's very advanced, but it is doing something.", 'start': 1763.64, 'duration': 3.764}], 'summary': 'Prettier formatted the code, added url and date to console, can save to file with fs module, unlimited middleware possibilities.', 'duration': 29.496, 'max_score': 1737.908, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1737908.jpg'}, {'end': 1878.845, 'src': 'embed', 'start': 1850.883, 'weight': 4, 'content': [{'end': 1856.65, 'text': "And as many requests as we make, if I just hit this a couple times, it'll keep logging.", 'start': 1850.883, 'duration': 5.767}, {'end': 1864.959, 'text': "Now, I don't actually want this to keep running, so I'm just going to comment out the initializer here so it doesn't actually log anymore.", 'start': 1858.232, 'duration': 6.727}, {'end': 1868.841, 'text': "Now you can see how middleware works, how it's implemented.", 'start': 1865.66, 'duration': 3.181}, {'end': 1870.662, 'text': "So we're going to move on.", 'start': 1868.861, 'duration': 1.801}, {'end': 1878.845, 'text': "Now, the next thing I want to do in terms of our little API that we're creating is I want to get a single member, an individual member.", 'start': 1870.682, 'duration': 8.163}], 'summary': 'Demonstrated middleware implementation and planned to create a single member api.', 'duration': 27.962, 'max_score': 1850.883, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1850883.jpg'}, {'end': 1988.169, 'src': 'embed', 'start': 1960.74, 'weight': 5, 'content': [{'end': 1965.162, 'text': "We want to get if we want the member with the idea for which there isn't one.", 'start': 1960.74, 'duration': 4.422}, {'end': 1967.824, 'text': "But let's go ahead and get rid of this.", 'start': 1965.963, 'duration': 1.861}, {'end': 1971.626, 'text': "And let's just do a res dot Jason.", 'start': 1969.404, 'duration': 2.222}, {'end': 1974.766, 'text': "and i mean there's different ways we could do this.", 'start': 1972.706, 'duration': 2.06}, {'end': 1982.848, 'text': "i'm going to use the filter method, which will take an array and just filter things out, filtered out based on a condition.", 'start': 1974.766, 'duration': 8.082}, {'end': 1985.828, 'text': "so we'll take the members array filter.", 'start': 1982.848, 'duration': 2.98}, {'end': 1988.169, 'text': "okay. so it's a method we tack on to it.", 'start': 1985.828, 'duration': 2.341}], 'summary': 'Using the filter method to remove elements from the members array based on a condition.', 'duration': 27.429, 'max_score': 1960.74, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1960740.jpg'}], 'start': 1496.665, 'title': 'Middleware and api creation in node.js', 'summary': 'Covers implementing middleware in node.js, including creating a simple middleware function, utilizing request and response objects, importing third-party packages, and organizing middleware functions. additionally, it explains creating an api endpoint to retrieve a single member by their id using request parameters and javascript methods.', 'chapters': [{'end': 1870.662, 'start': 1496.665, 'title': 'Implementing middleware in node.js', 'summary': 'Covers the implementation of middleware in node.js, including creating a simple middleware function to log request details and date, utilizing the request and response objects, importing third-party packages like moment to format dates, and organizing middleware functions in separate files for reusability and maintainability.', 'duration': 373.997, 'highlights': ['The chapter covers the implementation of middleware in Node.js Key point: focus on implementing middleware in Node.js', 'Creating a simple middleware function to log request details and date Quantifiable data: logs the URL and date for every request', 'Utilizing the request and response objects for middleware Key point: demonstrates the use of request and response objects for middleware functionality', 'Importing moment package to format dates Quantifiable data: utilizes moment package for date formatting', 'Organizing middleware functions in separate files for reusability and maintainability Key point: emphasizes the importance of organizing middleware functions for reusability and maintainability']}, {'end': 2145.246, 'start': 1870.682, 'title': 'Creating api to get single member', 'summary': 'Explains how to create an api endpoint to retrieve a single member by their id, utilizing request parameters and javascript methods like filter, parseint, and some, with examples demonstrating the functionality of the api.', 'duration': 274.564, 'highlights': ['The chapter explains how to create a API endpoint to retrieve a single member by their ID The chapter discusses the process of creating an API endpoint to fetch a single member by specifying their ID.', 'Utilizing request parameters and JavaScript methods like filter, parseInt, and some The transcript demonstrates the use of request parameters and JavaScript methods such as filter, parseInt, and some to manipulate and retrieve data from the API.', 'Examples demonstrating the functionality of the API The examples provided in the transcript illustrate the functionality of the API, including retrieving a member by ID and handling cases where the specified member ID does not exist.']}], 'duration': 648.581, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE1496665.jpg', 'highlights': ['Focus on implementing middleware in Node.js', 'Utilizes moment package for date formatting', 'Demonstrates the use of request and response objects for middleware functionality', 'Emphasizes the importance of organizing middleware functions for reusability and maintainability', 'Explains the process of creating an API endpoint to fetch a single member by specifying their ID', 'Demonstrates the use of request parameters and JavaScript methods such as filter, parseInt, and some to manipulate and retrieve data from the API', 'Illustrates the functionality of the API, including retrieving a member by ID and handling cases where the specified member ID does not exist', 'Creates a simple middleware function to log request details and date, logging the URL and date for every request']}, {'end': 2760.638, 'segs': [{'end': 2196.306, 'src': 'embed', 'start': 2146.087, 'weight': 0, 'content': [{'end': 2154.479, 'text': "So how do we want to handle this if there isn't a member of that ID? Now, this is where HTTP statuses come in.", 'start': 2146.087, 'duration': 8.392}, {'end': 2158.142, 'text': 'if we just do res.json and everything is fine.', 'start': 2155.22, 'duration': 2.922}, {'end': 2163.044, 'text': "you'll see that in postman it's a 200 status, which means everything's okay.", 'start': 2158.142, 'duration': 4.902}, {'end': 2171.789, 'text': "now the status i want to give if there isn't a member with that id is a 400, because that means that it's a bad request.", 'start': 2163.044, 'duration': 8.745}, {'end': 2178.993, 'text': "it means they didn't give us the correct request information to give them a correct response.", 'start': 2171.789, 'duration': 7.204}, {'end': 2185.997, 'text': "so we're going to do res.status, so we can set the status to something different And we're going to set it to 400..", 'start': 2178.993, 'duration': 7.004}, {'end': 2190, 'text': 'And then we can just do .json and we can tack in whatever we want.', 'start': 2185.997, 'duration': 4.003}, {'end': 2191.562, 'text': 'Usually some kind of message.', 'start': 2190.12, 'duration': 1.442}, {'end': 2196.306, 'text': "So I'm just going to say message member not found.", 'start': 2192.162, 'duration': 4.144}], 'summary': 'Set http status to 400 if member not found.', 'duration': 50.219, 'max_score': 2146.087, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2146087.jpg'}, {'end': 2277.681, 'src': 'embed', 'start': 2228.588, 'weight': 2, 'content': [{'end': 2235.073, 'text': "we'll try to get member six and we get message no member with the id of six and notice.", 'start': 2228.588, 'duration': 6.485}, {'end': 2238.777, 'text': 'we also are giving a 400 bad request.', 'start': 2235.073, 'duration': 3.704}, {'end': 2244.382, 'text': "so let's go back in and now i want to be able to actually create a member.", 'start': 2238.777, 'duration': 5.605}, {'end': 2248.726, 'text': "now, having all these routes in our index file, it's getting kind of cramped up.", 'start': 2244.382, 'duration': 4.344}, {'end': 2250.107, 'text': "actually, i'm going to close all these up.", 'start': 2248.726, 'duration': 1.381}, {'end': 2251.048, 'text': "we don't need these open.", 'start': 2250.107, 'duration': 0.941}, {'end': 2253.503, 'text': 'So this is getting cramped up.', 'start': 2252.222, 'duration': 1.281}, {'end': 2263.47, 'text': 'so we can use the router that comes with Express to put all of our, all of our similar routes into a single file.', 'start': 2253.503, 'duration': 9.967}, {'end': 2269.915, 'text': "So I'm going to create a folder in our route here called routes and inside routes.", 'start': 2263.57, 'duration': 6.345}, {'end': 2277.681, 'text': "I'm going to create a folder called API just because not all of our routes might they might not all be APIs where we're serving Jason.", 'start': 2269.935, 'duration': 7.746}], 'summary': 'Unable to get member with id six, planning to organize routes into a single file using express router.', 'duration': 49.093, 'max_score': 2228.588, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2228588.jpg'}, {'end': 2327.581, 'src': 'embed', 'start': 2301.738, 'weight': 4, 'content': [{'end': 2306.101, 'text': "So you're going to see it's going to be different from application to application.", 'start': 2301.738, 'duration': 4.363}, {'end': 2316.494, 'text': "So let's take both of these routes, the all members and single member, and let's cut that out and let's put it in members.", 'start': 2307.268, 'duration': 9.226}, {'end': 2317.855, 'text': 'All right.', 'start': 2317.515, 'duration': 0.34}, {'end': 2323.758, 'text': 'Now, in order to use the express router, in order for this to work, we need to do a couple of things here.', 'start': 2317.975, 'duration': 5.783}, {'end': 2327.581, 'text': 'So we need to bring in express so that we can use the router.', 'start': 2323.818, 'duration': 3.763}], 'summary': 'Using express router for different application routes, requiring express to use the router.', 'duration': 25.843, 'max_score': 2301.738, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2301738.jpg'}, {'end': 2634.402, 'src': 'embed', 'start': 2607.449, 'weight': 5, 'content': [{'end': 2611.45, 'text': 'Now, if I send this, if we look down here, we get nothing back.', 'start': 2607.449, 'duration': 4.001}, {'end': 2613.911, 'text': 'We get a 200 response, but nothing back.', 'start': 2611.691, 'duration': 2.22}, {'end': 2621.855, 'text': "And the reason for that is we need to include to use a body parser so that we can parse the data that we're sending in the body.", 'start': 2614.352, 'duration': 7.503}, {'end': 2625.697, 'text': 'now you used to have to install a separate body parser.', 'start': 2622.435, 'duration': 3.262}, {'end': 2628.879, 'text': 'it was a third-party package that you had to install.', 'start': 2625.697, 'duration': 3.182}, {'end': 2632.141, 'text': "however, with the newest version of express, we don't have to do that.", 'start': 2628.879, 'duration': 3.262}, {'end': 2634.402, 'text': "there's one included with express.", 'start': 2632.141, 'duration': 2.261}], 'summary': 'To parse data, use body parser in express, no need to install separate package.', 'duration': 26.953, 'max_score': 2607.449, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2607449.jpg'}, {'end': 2728.182, 'src': 'embed', 'start': 2695.084, 'weight': 3, 'content': [{'end': 2697.085, 'text': "obviously we don't want to just send that back.", 'start': 2695.084, 'duration': 2.001}, {'end': 2700.226, 'text': 'we want to create a new member.', 'start': 2697.085, 'duration': 3.141}, {'end': 2706.487, 'text': "so i'm going to create a variable here called new member and set this to be an object.", 'start': 2700.226, 'duration': 6.261}, {'end': 2719.136, 'text': "Now, usually when you're dealing with IDs and you're using a database like MongoDB or MySQL or Postgres, it usually creates the ID for you.", 'start': 2707.208, 'duration': 11.928}, {'end': 2721.517, 'text': "So we're not using a database.", 'start': 2719.756, 'duration': 1.761}, {'end': 2728.182, 'text': "So I'm going to actually install something called UUID, which will generate a random ID for us.", 'start': 2721.537, 'duration': 6.645}], 'summary': 'Creating a new member object with a random id using uuid.', 'duration': 33.098, 'max_score': 2695.084, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2695084.jpg'}], 'start': 2146.087, 'title': 'Managing http statuses and api routes in node.js', 'summary': 'Discusses handling various http statuses in node.js, including using 400 status for bad requests and setting custom messages. it also covers organizing similar routes into a single file using express router, handling get and post requests, and configuring body parsing middleware for efficient api route management and data handling.', 'chapters': [{'end': 2253.503, 'start': 2146.087, 'title': 'Handling http statuses in node.js', 'summary': 'Discusses handling different http statuses in node.js, such as using a 400 status for bad requests and setting custom messages for responses when a member with a specific id is not found.', 'duration': 107.416, 'highlights': ["Setting a 400 status for bad requests, indicating incorrect request information, and providing a custom message like 'member not found'.", 'Using backticks to construct cleaner response messages with dynamic content like the requested member ID.']}, {'end': 2760.638, 'start': 2253.503, 'title': 'Express router for handling api routes', 'summary': 'Covers organizing similar routes into a single file using express router, handling get and post requests, and configuring body parsing middleware, allowing for efficient api route management and data handling.', 'duration': 507.135, 'highlights': ['The chapter covers organizing similar routes into a single file using Express router, handling GET and POST requests, and configuring body parsing middleware, allowing for efficient API route management and data handling.', 'Express allows full freedom to structure files and code, enabling different approaches across applications.', 'Using the express router for handling requests, such as router.get and router.post, allows for efficient management of API routes and different HTTP methods.', 'Setting up body parsing middleware with express.json and express.urlencoded enables handling raw JSON and form submissions for efficient data processing.', 'Installing UUID to generate random IDs for new members when handling post requests, providing a unique identifier for each newly created member.']}], 'duration': 614.551, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2146087.jpg', 'highlights': ["Setting a 400 status for bad requests, indicating incorrect request information, and providing a custom message like 'member not found'.", 'Using backticks to construct cleaner response messages with dynamic content like the requested member ID.', 'The chapter covers organizing similar routes into a single file using Express router, handling GET and POST requests, and configuring body parsing middleware, allowing for efficient API route management and data handling.', 'Installing UUID to generate random IDs for new members when handling post requests, providing a unique identifier for each newly created member.', 'Using the express router for handling requests, such as router.get and router.post, allows for efficient management of API routes and different HTTP methods.', 'Setting up body parsing middleware with express.json and express.urlencoded enables handling raw JSON and form submissions for efficient data processing.', 'Express allows full freedom to structure files and code, enabling different approaches across applications.']}, {'end': 3442.671, 'segs': [{'end': 2792.108, 'src': 'embed', 'start': 2760.778, 'weight': 0, 'content': [{'end': 2764.338, 'text': 'And then for the name, we want to get that from request our body.', 'start': 2760.778, 'duration': 3.56}, {'end': 2769.82, 'text': "OK, so we want request our body name, the email we're sending in the body as well.", 'start': 2764.358, 'duration': 5.462}, {'end': 2773.981, 'text': 'So request our body dot email and then status.', 'start': 2770.82, 'duration': 3.161}, {'end': 2775.901, 'text': "I'm just going to set status to active.", 'start': 2774.061, 'duration': 1.84}, {'end': 2780.961, 'text': "OK, so it'll always be set to active when a new member is created.", 'start': 2776.892, 'duration': 4.069}, {'end': 2786.212, 'text': "All right, so let's see, we have this object now.", 'start': 2782.885, 'duration': 3.327}, {'end': 2792.108, 'text': 'We want to add this new member onto our array.', 'start': 2787.847, 'duration': 4.261}], 'summary': 'Extracts name and email from request body to set status as active for new member creation.', 'duration': 31.33, 'max_score': 2760.778, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2760778.jpg'}, {'end': 2979.605, 'src': 'embed', 'start': 2949.705, 'weight': 1, 'content': [{'end': 2951.186, 'text': "obviously you're going to have a database.", 'start': 2949.705, 'duration': 1.481}, {'end': 2958.552, 'text': "you're not just going to have a file with your data, and i don't want to get into that because that's something it's just.", 'start': 2951.186, 'duration': 7.366}, {'end': 2967.418, 'text': "i want to stick, to express as much as i can, without going into, you know mongodb or certain databases, but what will happen is you'll just.", 'start': 2958.552, 'duration': 8.866}, {'end': 2979.605, 'text': "you'll install a package like Mongoose, which is an object relational or object data mapper for MongoDB,", 'start': 2967.418, 'duration': 12.187}], 'summary': 'A database is essential, and using mongoose for mongodb is recommended.', 'duration': 29.9, 'max_score': 2949.705, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2949705.jpg'}, {'end': 3346.956, 'src': 'embed', 'start': 3319.417, 'weight': 2, 'content': [{'end': 3323.921, 'text': 'So we get member updated and everything is the same except for the email.', 'start': 3319.417, 'duration': 4.504}, {'end': 3328.565, 'text': 'OK So we have just updated the email.', 'start': 3323.941, 'duration': 4.624}, {'end': 3329.666, 'text': 'The name is the same.', 'start': 3328.625, 'duration': 1.041}, {'end': 3330.868, 'text': 'Everything else is the same.', 'start': 3329.706, 'duration': 1.162}, {'end': 3331.848, 'text': 'All right.', 'start': 3331.548, 'duration': 0.3}, {'end': 3333.769, 'text': 'And obviously this stuff is just in memory.', 'start': 3331.948, 'duration': 1.821}, {'end': 3334.75, 'text': "There's no database.", 'start': 3333.809, 'duration': 0.941}, {'end': 3335.97, 'text': "It's not getting persisted.", 'start': 3334.79, 'duration': 1.18}, {'end': 3340.833, 'text': 'But again, the request, the response, all that stuff is going to be the same.', 'start': 3336.871, 'duration': 3.962}, {'end': 3343.454, 'text': "It's just this functionality.", 'start': 3341.253, 'duration': 2.201}, {'end': 3346.956, 'text': "This stuff here will be different if you're using a database.", 'start': 3343.474, 'duration': 3.482}], 'summary': 'Member details updated, only email changed. no database persistence.', 'duration': 27.539, 'max_score': 3319.417, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3319417.jpg'}], 'start': 2760.778, 'title': 'Node.js member management and creating api endpoints', 'summary': 'Covers adding a new member to an array with a validation check for name and email, responding with the updated array, and demonstrates crud operations with mongoose for mongodb and sequelize for sql databases, including creating, updating, and deleting members with sample requests and responses.', 'chapters': [{'end': 2949.705, 'start': 2760.778, 'title': 'Node.js member management', 'summary': 'Covers adding a new member to an array, including a validation check for name and email, and responding with the updated array, with a demonstration of the process and handling of errors.', 'duration': 188.927, 'highlights': ['Demonstrates adding a new member to an array and includes a validation check for name and email. new member object, 400 status code for bad request', 'Shows the process of handling errors and returning a response in case of a bad request. res.status, JSON message', 'Illustrates responding with the updated array of members after adding a new member. returning the entire array of members']}, {'end': 3442.671, 'start': 2949.705, 'title': 'Creating api endpoints', 'summary': 'Covers creating api endpoints for crud operations with javascript, including using mongoose for mongodb and sequelize for sql databases, and demonstrates the implementation of creating, updating, and deleting members with sample requests and responses.', 'duration': 492.966, 'highlights': ['The chapter covers creating API endpoints for CRUD operations with JavaScript, including using Mongoose for MongoDB and Sequelize for SQL databases. Demonstrates the utilization of Mongoose for MongoDB and Sequelize for SQL databases for creating API endpoints.', 'The implementation of creating, updating, and deleting members is demonstrated with sample requests and responses. Provides a detailed demonstration of creating, updating, and deleting members with sample requests and responses.']}], 'duration': 681.893, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE2760778.jpg', 'highlights': ['Covers adding a new member to an array with a validation check for name and email, responding with the updated array', 'Demonstrates the utilization of Mongoose for MongoDB and Sequelize for SQL databases for creating API endpoints', 'Provides a detailed demonstration of creating, updating, and deleting members with sample requests and responses', 'Shows the process of handling errors and returning a response in case of a bad request']}, {'end': 3845.182, 'segs': [{'end': 3496.702, 'src': 'embed', 'start': 3442.751, 'weight': 0, 'content': [{'end': 3446.113, 'text': 'And then we just want to and put our curly brace here.', 'start': 3442.751, 'duration': 3.362}, {'end': 3447.833, 'text': 'All right.', 'start': 3447.533, 'duration': 0.3}, {'end': 3451.495, 'text': "So let's save that prettier, fixed it up so you can see it a little better.", 'start': 3447.853, 'duration': 3.642}, {'end': 3457.292, 'text': 'And now if we go and we make a delete request, to this.', 'start': 3452.235, 'duration': 5.057}, {'end': 3462.514, 'text': "Let's delete the first one, John Doe, and send.", 'start': 3457.312, 'duration': 5.202}, {'end': 3464.555, 'text': 'We get member deleted.', 'start': 3463.394, 'duration': 1.161}, {'end': 3467.556, 'text': 'And then if we look at our members array, John Doe is gone.', 'start': 3464.675, 'duration': 2.881}, {'end': 3472.638, 'text': "He's not there because we used filter to filter the ID of one out.", 'start': 3467.596, 'duration': 5.042}, {'end': 3474.615, 'text': 'All right.', 'start': 3474.275, 'duration': 0.34}, {'end': 3479.437, 'text': 'So we have a CRUD API where we can create, read, update and delete.', 'start': 3474.755, 'duration': 4.682}, {'end': 3484.518, 'text': 'So now I want to move on to rendering templates using a template engine.', 'start': 3480.017, 'duration': 4.501}, {'end': 3487.679, 'text': "And there's a lot of different template engines that you can use.", 'start': 3484.878, 'duration': 2.801}, {'end': 3490.84, 'text': "We're going to go ahead and use express.", 'start': 3488.619, 'duration': 2.221}, {'end': 3496.702, 'text': 'Handlebars So if we go to the GitHub for that.', 'start': 3492.301, 'duration': 4.401}], 'summary': 'Demonstrated crud api functionality with delete request and rendering templates using handlebars in the context of express.', 'duration': 53.951, 'max_score': 3442.751, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3442751.jpg'}, {'end': 3676.862, 'src': 'embed', 'start': 3652.535, 'weight': 1, 'content': [{'end': 3658.797, 'text': "members app and let's just grab bootstrap so that we can make this look decent now.", 'start': 3652.535, 'duration': 6.262}, {'end': 3660.577, 'text': 'for let me just explain.', 'start': 3658.797, 'duration': 1.78}, {'end': 3667.679, 'text': "for the most part you're you're not really going to do this where you have a json api and then you also have server rendered templates.", 'start': 3660.577, 'duration': 7.102}, {'end': 3669.42, 'text': "it's usually going to be one or the other.", 'start': 3667.679, 'duration': 1.741}, {'end': 3676.862, 'text': "you're usually going to either be building an api so that you can have react or view or something on the front end, and you're just serving json,", 'start': 3669.42, 'duration': 7.442}], 'summary': 'Json apis and server-rendered templates are usually separate, not a combination.', 'duration': 24.327, 'max_score': 3652.535, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3652535.jpg'}], 'start': 3442.751, 'title': 'Api, template rendering, and bootstrap integration', 'summary': 'Covers the creation of a crud api for member management, implementation of template rendering using express handlebars, and integration of bootstrap in a server-side application with json api and server-rendered templates, including the creation of index page view and routing.', 'chapters': [{'end': 3649.331, 'start': 3442.751, 'title': 'Crud api and template rendering', 'summary': 'Demonstrates the creation of a crud api enabling users to create, read, update, and delete members, followed by the implementation of template rendering using express handlebars to simplify the process.', 'duration': 206.58, 'highlights': ['The chapter demonstrates the creation of a CRUD API enabling users to create, read, update, and delete members. The API allows for CRUD operations, exemplified by the successful deletion of a member, John Doe, using a delete request and the filtering out of the ID of the deleted member from the members array.', 'Implementation of template rendering using Express Handlebars to simplify the process. The use of Express Handlebars as a template engine allows for the creation of a main layout to wrap everything and individual views, simplifying the rendering process using res.render and enhancing the overall user experience.']}, {'end': 3845.182, 'start': 3652.535, 'title': 'Server-side app with bootstrap integration', 'summary': 'Explains the integration of bootstrap in a server-side application, discussing the use of json api and server-rendered templates, and the creation of index page view and routing.', 'duration': 192.647, 'highlights': ['Bootstrap integration in a server-side app is demonstrated, emphasizing the use of JSON API or server-rendered templates.', 'The process of creating an index page view and corresponding routing is explained within the context of the server-side application.', 'The significance of integrating static HTML files in a server-side app for reference is highlighted, acknowledging the usual practice of choosing either JSON API or server-rendered templates.']}], 'duration': 402.431, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3442751.jpg', 'highlights': ['The chapter demonstrates the creation of a CRUD API enabling users to create, read, update, and delete members.', 'Bootstrap integration in a server-side app is demonstrated, emphasizing the use of JSON API or server-rendered templates.', 'Implementation of template rendering using Express Handlebars to simplify the process.']}, {'end': 4438.489, 'segs': [{'end': 3910.941, 'src': 'embed', 'start': 3875.579, 'weight': 3, 'content': [{'end': 3883.841, 'text': "And we'll put, let's just put like member app.", 'start': 3875.579, 'duration': 8.262}, {'end': 3892.622, 'text': "And then we'll go to index and let's replace this now to use a variable with handlebars.", 'start': 3886.454, 'duration': 6.168}, {'end': 3895.005, 'text': 'We just use double curly braces like that.', 'start': 3892.642, 'duration': 2.363}, {'end': 3896.807, 'text': "And we'll just say title.", 'start': 3895.626, 'duration': 1.181}, {'end': 3901.092, 'text': 'So now if we go back, we get members app.', 'start': 3897.989, 'duration': 3.103}, {'end': 3902.875, 'text': 'All right.', 'start': 3902.614, 'duration': 0.261}, {'end': 3904.076, 'text': "I'm just going to center that.", 'start': 3902.955, 'duration': 1.121}, {'end': 3905.218, 'text': "So let's do class.", 'start': 3904.176, 'duration': 1.042}, {'end': 3910.941, 'text': 'Text center will do margin bottom three.', 'start': 3907.398, 'duration': 3.543}], 'summary': "Updating the index to use a variable with handlebars for the title, resulting in 'members app' display.", 'duration': 35.362, 'max_score': 3875.579, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3875579.jpg'}, {'end': 3970.677, 'src': 'embed', 'start': 3945.707, 'weight': 4, 'content': [{'end': 3950.889, 'text': "And that's all we need to do because doing this is the same thing.", 'start': 3945.707, 'duration': 5.182}, {'end': 3961.635, 'text': 'Now this is an array, so in our template we want to loop through it and then output whatever we want,', 'start': 3954.133, 'duration': 7.502}, {'end': 3964.415, 'text': "whether it's just the name or the name and email, and so on.", 'start': 3961.635, 'duration': 2.78}, {'end': 3970.677, 'text': "So I'm going to put in each four here and we're just going to say members and then let's do a UL.", 'start': 3964.935, 'duration': 5.742}], 'summary': 'Loop through an array to output name and email in a template.', 'duration': 24.97, 'max_score': 3945.707, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3945707.jpg'}, {'end': 4032.484, 'src': 'embed', 'start': 4002.997, 'weight': 2, 'content': [{'end': 4004.438, 'text': "So we'll say list group.", 'start': 4002.997, 'duration': 1.441}, {'end': 4007.581, 'text': 'And then each list item.', 'start': 4006.36, 'duration': 1.221}, {'end': 4012.698, 'text': "We'll do list group item.", 'start': 4009.175, 'duration': 3.523}, {'end': 4014.02, 'text': 'All right.', 'start': 4012.718, 'duration': 1.302}, {'end': 4014.8, 'text': "So let's save that.", 'start': 4014.04, 'duration': 0.76}, {'end': 4016.382, 'text': "Let's go back and reload.", 'start': 4014.84, 'duration': 1.542}, {'end': 4019.165, 'text': "And you can see that it's loading those members.", 'start': 4016.922, 'duration': 2.243}, {'end': 4029.001, 'text': 'OK Now, last thing I want to do is create a form so that we can actually make a request to our API to add a member from the form.', 'start': 4020.532, 'duration': 8.469}, {'end': 4032.484, 'text': "So I'll just put it in the same file.", 'start': 4030.062, 'duration': 2.422}], 'summary': 'Creating list group and form to add members to api.', 'duration': 29.487, 'max_score': 4002.997, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE4002997.jpg'}, {'end': 4320.731, 'src': 'embed', 'start': 4294.293, 'weight': 0, 'content': [{'end': 4302.241, 'text': 'as well as rendering templates on the server, as well as having a static folder where you can just add HTML files, CSS and so on.', 'start': 4294.293, 'duration': 7.948}, {'end': 4308.465, 'text': "Now, as far as authentication, for the most part, you're going to obviously you'll have some kind of database.", 'start': 4302.799, 'duration': 5.666}, {'end': 4310.907, 'text': "So let's say you use MongoDB with Mongoose.", 'start': 4308.545, 'duration': 2.362}, {'end': 4314.731, 'text': "You're going to create a user's model with a login, a register.", 'start': 4311.387, 'duration': 3.344}, {'end': 4320.731, 'text': "And if you're building a full stack app like, let's say, you have Vue or React on the front end,", 'start': 4315.93, 'duration': 4.801}], 'summary': 'Server-side rendering, static folder, using mongodb with mongoose for user authentication in full stack app with vue or react.', 'duration': 26.438, 'max_score': 4294.293, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE4294293.jpg'}, {'end': 4358.084, 'src': 'embed', 'start': 4334.234, 'weight': 1, 'content': [{'end': 4342.216, 'text': "In fact, you can use Passport with a full stack as well because if we look at strategies, there's a bunch of different things, including JWT.", 'start': 4334.234, 'duration': 7.982}, {'end': 4349.259, 'text': "Passport Local, however, is what you would use if you're just dealing with just Express, just a server-side app.", 'start': 4342.976, 'duration': 6.283}, {'end': 4354.862, 'text': 'And I do have a whole project using Passport Local on YouTube.', 'start': 4349.76, 'duration': 5.102}, {'end': 4358.084, 'text': 'I do have some stuff with JWT as well on YouTube.', 'start': 4355.262, 'duration': 2.822}], 'summary': 'Passport can be used with full stack and express, including jwt. project using passport local and jwt available on youtube.', 'duration': 23.85, 'max_score': 4334.234, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE4334234.jpg'}], 'start': 3845.182, 'title': 'Web development and json api', 'summary': 'Covers adding data to a web app using handlebars, creating a form for making requests to the api, resulting in the display of members and the ability to add new members. it also discusses building a json api and server-side rendering, including examples of adding members, redirecting, and using passport for authentication, with mentions of mongoose, jwt, and express.', 'chapters': [{'end': 4163.881, 'start': 3845.182, 'title': 'Adding data and forms in web development', 'summary': 'Covers adding data to a web app using handlebars, including passing data objects, looping through arrays, and creating a form for making requests to the api, resulting in the display of members and the ability to add new members.', 'duration': 318.699, 'highlights': ["Passing data objects in Handlebars using a second parameter in the render function The render function takes in a second parameter of an object, allowing the passing of data objects, such as 'title' for displaying 'members app'.", "Looping through and displaying members using Handlebars each block The 'each' block in Handlebars is used to loop through the members array and display their names and emails, along with adding Bootstrap classes for styling.", "Creating a form for making POST requests to the API to add new members A form with action set to '/API/members' and method set to POST is created, allowing the addition of new members to the web app through the API."]}, {'end': 4438.489, 'start': 4164.622, 'title': 'Building json api and server-side rendering', 'summary': 'Discusses building a json api and server-side rendering, including examples of adding members, redirecting, and using passport for authentication, with mentions of mongoose, jwt, and express.', 'duration': 273.867, 'highlights': ['The chapter discusses building a JSON API and server-side rendering, including examples of adding members, redirecting, and using Passport for authentication. It covers building a JSON API, showing examples of adding members, redirecting, and using Passport for authentication, along with mentions of Mongoose, JWT, and Express.', 'The best example of authentication is shown in the MernStack course, which includes building a React application, using Express on the back end, and sending JSON Web tokens to authenticate. The MernStack course is highlighted as the best example for authentication, involving building a React application, using Express on the back end, and employing JSON Web tokens for authentication.', 'The chapter also promotes a resource for starting a freelance business at studywebdevelopment.com/freelancing, offering a 130-page guide to freelancing, invoice templates, client proposals, HTML and CSS templates, a portfolio website, access to a private Facebook community, and more, with a 25% discount using code BRAD25. A resource for starting a freelance business is recommended at studywebdevelopment.com/freelancing, providing a 130-page guide to freelancing, invoice templates, client proposals, HTML and CSS templates, a portfolio website, access to a private Facebook community, and more, with a 25% discount using code BRAD25.']}], 'duration': 593.307, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/L72fhGm1tfE/pics/L72fhGm1tfE3845182.jpg', 'highlights': ['The chapter discusses building a JSON API and server-side rendering, including examples of adding members, redirecting, and using Passport for authentication.', 'The best example of authentication is shown in the MernStack course, which includes building a React application, using Express on the back end, and sending JSON Web tokens to authenticate.', "Creating a form for making POST requests to the API to add new members A form with action set to '/API/members' and method set to POST is created, allowing the addition of new members to the web app through the API.", "Passing data objects in Handlebars using a second parameter in the render function The render function takes in a second parameter of an object, allowing the passing of data objects, such as 'title' for displaying 'members app'.", "Looping through and displaying members using Handlebars each block The 'each' block in Handlebars is used to loop through the members array and display their names and emails, along with adding Bootstrap classes for styling."]}], 'highlights': ['Express is the most popular framework, with examples like Koa, HappyJS, and Adonis falling behind in popularity.', 'Provides a comprehensive express crash course covering its features, use cases, and advantages, including setting up a server in vs code, creating routes and middleware functions, managing http statuses, api creation, member management, and template rendering with bootstrap integration, demonstrating examples with mongodb, postgres, mongoose, sequelize, and handlebars.', 'Covers fundamentals of Express framework, including MongoDB and Postgres with Node.', 'Handlebars and pjs are preferred template engines for rendering templates on the server.', 'Focus on implementing middleware in Node.js', "Setting a 400 status for bad requests, indicating incorrect request information, and providing a custom message like 'member not found'.", 'Covers adding a new member to an array with a validation check for name and email, responding with the updated array', 'The chapter demonstrates the creation of a CRUD API enabling users to create, read, update, and delete members.', 'The chapter discusses building a JSON API and server-side rendering, including examples of adding members, redirecting, and using Passport for authentication.']}