title
Full Stack Vue.js, Express & MongoDB [1] - Express API
description
In this 3 part series we will build a small app using Vue.js on the client, Express on the backend and MongoDB for our database and we will deploy to Heroku. The point of this series is to see how it all comes together
Sponsor: DevMountain Bootcamp
https://goo.gl/6q0dEa
Code:
https://github.com/bradtraversy/microposts_fullstack_vue
💖 Become a Patron: Show support & get perks!
http://www.patreon.com/traversymedia
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': 'Full Stack Vue.js, Express & MongoDB [1] - Express API', 'heatmap': [{'end': 233.978, 'start': 197.945, 'weight': 0.871}, {'end': 516.845, 'start': 488.918, 'weight': 0.829}, {'end': 618.021, 'start': 597.769, 'weight': 0.711}, {'end': 728.027, 'start': 684.581, 'weight': 0.774}, {'end': 1224.327, 'start': 1207.93, 'weight': 0.839}], 'summary': 'Learn to build a full stack vue.js, express, and mongodb application demonstrating backend api integration with vue.js, deployment to heroku, setting up mongodb databases on mlab and amazon web services, using node.js express and postman for api requests, and building a simple api with node.js and mongodb.', 'chapters': [{'end': 718.345, 'segs': [{'end': 86.453, 'src': 'embed', 'start': 62.665, 'weight': 0, 'content': [{'end': 70.351, 'text': 'with people learning full stack JavaScript is getting the back end and the front end working together and then deploying it and making it all work.', 'start': 62.665, 'duration': 7.686}, {'end': 72.594, 'text': 'So in the first video.', 'start': 71.172, 'duration': 1.422}, {'end': 81.186, 'text': "in this video we're going to create our back end express API and then in the next we'll create the front end view application and then in the last one,", 'start': 72.594, 'duration': 8.592}, {'end': 86.453, 'text': "we'll go ahead and build out our static assets from view and deploy to Heroku.", 'start': 81.186, 'duration': 5.267}], 'summary': 'Learning full stack javascript involves creating back end and front end, deploying, and making it work.', 'duration': 23.788, 'max_score': 62.665, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw62665.jpg'}, {'end': 189.463, 'src': 'embed', 'start': 163.784, 'weight': 2, 'content': [{'end': 170.109, 'text': "I'm using my VS Code integrated terminal and I just have a blank folder called Full Stack View Express.", 'start': 163.784, 'duration': 6.325}, {'end': 176.553, 'text': 'OK, and as far as extensions, what I would recommend is view to snippets.', 'start': 170.809, 'duration': 5.744}, {'end': 177.554, 'text': "OK, so I'm using that.", 'start': 176.573, 'duration': 0.981}, {'end': 180.957, 'text': "I'm also using view to which is view tooling for VS code.", 'start': 177.614, 'duration': 3.343}, {'end': 189.463, 'text': "I'm using bracket pair colorizer, which just, you know, makes it a little less confusing when you're dealing with conditionals and stuff like that.", 'start': 181.617, 'duration': 7.846}], 'summary': 'Using vs code with extensions for full stack view express project.', 'duration': 25.679, 'max_score': 163.784, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw163784.jpg'}, {'end': 233.978, 'src': 'heatmap', 'start': 197.945, 'weight': 0.871, 'content': [{'end': 201.946, 'text': "But I think that's it as far as, you know, what is relevant to this project.", 'start': 197.945, 'duration': 4.001}, {'end': 203.647, 'text': "So let's get started here.", 'start': 202.446, 'duration': 1.201}, {'end': 210.048, 'text': 'Since this is obviously a Node.js application, we want to run npm init to create a package.json file.', 'start': 203.707, 'duration': 6.341}, {'end': 214.53, 'text': "And I'm going to just hit enter for most of these.", 'start': 211.249, 'duration': 3.281}, {'end': 219.171, 'text': "Description, I'm going to say full stack view.", 'start': 214.63, 'duration': 4.541}, {'end': 225.247, 'text': 'and express app entry point.', 'start': 221.822, 'duration': 3.425}, {'end': 229.072, 'text': 'index js is good author.', 'start': 225.247, 'duration': 3.825}, {'end': 233.978, 'text': 'you can put your own name if you want mit license and there we go.', 'start': 229.072, 'duration': 4.906}], 'summary': 'Setting up a node.js application using npm init to create a package.json file for a full stack view and express app entry point.', 'duration': 36.033, 'max_score': 197.945, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw197945.jpg'}, {'end': 267.612, 'src': 'embed', 'start': 237.409, 'weight': 1, 'content': [{'end': 239.671, 'text': "Now let's install the dependencies that we're going to need.", 'start': 237.409, 'duration': 2.262}, {'end': 242.193, 'text': "So we're going to say npm install express.", 'start': 239.711, 'duration': 2.482}, {'end': 247.137, 'text': "of course we're also going to need cores because we don't want to get that.", 'start': 242.193, 'duration': 4.944}, {'end': 251.301, 'text': 'that that annoying Chrome error, that cross cross origin.', 'start': 247.137, 'duration': 4.164}, {'end': 253.222, 'text': 'you know, allow cross origin whatever.', 'start': 251.301, 'duration': 1.921}, {'end': 255.184, 'text': 'this is going to stop that error from happening.', 'start': 253.222, 'duration': 1.962}, {'end': 258.305, 'text': 'so we can make requests from other domains and stuff.', 'start': 256.043, 'duration': 2.262}, {'end': 263.349, 'text': 'And this API is going to be completely public, at least not in these three videos.', 'start': 258.346, 'duration': 5.003}, {'end': 267.612, 'text': "We're not going to implement authentication or tokens or anything like that.", 'start': 263.589, 'duration': 4.023}], 'summary': 'Installing npm dependencies including express and cores to prevent cross-origin errors. api will be public with no authentication or tokens.', 'duration': 30.203, 'max_score': 237.409, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw237409.jpg'}, {'end': 516.845, 'src': 'heatmap', 'start': 488.918, 'weight': 0.829, 'content': [{'end': 491.258, 'text': 'So just having this should allow us to run our server.', 'start': 488.918, 'duration': 2.34}, {'end': 494.379, 'text': "Make sure you're in the root directory here, not in the server.", 'start': 491.658, 'duration': 2.721}, {'end': 496.239, 'text': "And we're going to run NPM.", 'start': 494.759, 'duration': 1.48}, {'end': 498.38, 'text': "Let's do run dev.", 'start': 497.3, 'duration': 1.08}, {'end': 499.56, 'text': "That'll run node mon.", 'start': 498.4, 'duration': 1.16}, {'end': 501.821, 'text': "OK, so we're running on port 5000.", 'start': 500.44, 'duration': 1.381}, {'end': 516.845, 'text': "If I were to go to local host 5000, or any route on localhost 5000, we're going to get, cannot get slash or whatever route we put in here,", 'start': 501.821, 'duration': 15.024}], 'summary': 'Running the server on port 5000 with npm run dev command.', 'duration': 27.927, 'max_score': 488.918, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw488918.jpg'}, {'end': 630.873, 'src': 'heatmap', 'start': 597.769, 'weight': 0.711, 'content': [{'end': 598.83, 'text': "So let's save this.", 'start': 597.769, 'duration': 1.061}, {'end': 604.033, 'text': "Let's go to, and it's going to give us an error right now because we haven't set up the router in Post.js.", 'start': 598.91, 'duration': 5.123}, {'end': 608.035, 'text': "So let's go in Post.js and let's set that up.", 'start': 604.653, 'duration': 3.382}, {'end': 611.057, 'text': 'So we want to first of all bring in Express.', 'start': 608.736, 'duration': 2.321}, {'end': 618.021, 'text': 'So require Express.', 'start': 612.818, 'duration': 5.203}, {'end': 623.725, 'text': "Okay, let's also bring in the MongoDB driver.", 'start': 618.041, 'duration': 5.684}, {'end': 630.873, 'text': 'All right.', 'start': 630.473, 'duration': 0.4}], 'summary': 'Fix router error in post.js for express and mongodb driver.', 'duration': 33.104, 'max_score': 597.769, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw597769.jpg'}], 'start': 7.059, 'title': 'Building a full stack vue.js application', 'summary': 'Details the process of building a simple full stack vue.js, express, and mongodb application with the objective of demonstrating the integration of backend api with vue.js, deploying to heroku, and includes recommendations for essential tools and dependencies. it also covers the initial steps of creating the express api and setting up the server.', 'chapters': [{'end': 718.345, 'start': 7.059, 'title': 'Building a full stack vue.js application', 'summary': 'Details the process of building a simple full stack vue.js, express, and mongodb application with the objective of demonstrating the integration of backend api with vue.js, deploying to heroku, and includes recommendations for essential tools and dependencies. it also covers the initial steps of creating the express api and setting up the server.', 'duration': 711.286, 'highlights': ['Creating Express API and Setting Up Server The chapter focuses on creating the Express API and setting up the server, emphasizing the integration of backend API with Vue.js, and deploying to Heroku.', 'Installation of Dependencies The chapter discusses the installation of essential dependencies including Express, Cors, Body-Parser, MongoDB, and Nodemon for the server, with the aim of facilitating smooth server operations.', 'Recommendations for Essential Tools and Dependencies The chapter provides recommendations for essential tools such as VS Code extensions and dependencies including View Tooling and Prettier, facilitating an efficient development environment.']}], 'duration': 711.286, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw7059.jpg', 'highlights': ['Creating Express API and Setting Up Server The chapter focuses on creating the Express API and setting up the server, emphasizing the integration of backend API with Vue.js, and deploying to Heroku.', 'Installation of Dependencies The chapter discusses the installation of essential dependencies including Express, Cors, Body-Parser, MongoDB, and Nodemon for the server, with the aim of facilitating smooth server operations.', 'Recommendations for Essential Tools and Dependencies The chapter provides recommendations for essential tools such as VS Code extensions and dependencies including View Tooling and Prettier, facilitating an efficient development environment.']}, {'end': 927.631, 'segs': [{'end': 826.403, 'src': 'embed', 'start': 718.345, 'weight': 0, 'content': [{'end': 725.026, 'text': 'so now what i want to do is is start to work with mongodb, but before we do that, we need a mongodb database.', 'start': 718.345, 'duration': 6.681}, {'end': 728.027, 'text': "so i'm going to go to mlab.com.", 'start': 725.026, 'duration': 3.001}, {'end': 729.167, 'text': 'just go ahead and sign up.', 'start': 728.027, 'duration': 1.14}, {'end': 731.207, 'text': "it's completely free to sign up.", 'start': 729.167, 'duration': 2.04}, {'end': 739.449, 'text': 'you can create a a certain level of database, certain amount of storage and stuff like that, which is perfectly fine for development.', 'start': 731.207, 'duration': 8.242}, {'end': 746.973, 'text': "if you were to create a production application where you expect a lot of traffic and you're going to store a bunch of stuff,", 'start': 739.449, 'duration': 7.524}, {'end': 750.475, 'text': 'then you want to upgrade to a premium plan.', 'start': 746.973, 'duration': 3.502}, {'end': 757.08, 'text': "OK, just like with anything, just like with Heroku, it's great for a development or even small, small applications.", 'start': 750.495, 'duration': 6.585}, {'end': 764.145, 'text': "But when you, when you're building something of substance, that that is going to be like something popular in production,", 'start': 758, 'duration': 6.145}, {'end': 768.608, 'text': "then you're going to end up paying fees for for hosting and for storage and stuff like that.", 'start': 764.145, 'duration': 4.463}, {'end': 769.909, 'text': "It's just it's inevitable.", 'start': 768.668, 'duration': 1.241}, {'end': 773.15, 'text': "But yeah, everything here is free that we're doing.", 'start': 771.049, 'duration': 2.101}, {'end': 775.17, 'text': "So we're going to create a new deployment.", 'start': 773.25, 'duration': 1.92}, {'end': 778.832, 'text': "I'm going to choose Amazon Web Services as our cloud provider.", 'start': 775.19, 'duration': 3.642}, {'end': 780.432, 'text': "And let's see.", 'start': 779.532, 'duration': 0.9}, {'end': 781.632, 'text': 'It depends on where you are.', 'start': 780.452, 'duration': 1.18}, {'end': 783.033, 'text': "I'm going to choose U.S. East.", 'start': 781.652, 'duration': 1.381}, {'end': 789.035, 'text': "And database name, let's say view underscore express.", 'start': 784.934, 'duration': 4.101}, {'end': 792.456, 'text': 'And submit.', 'start': 791.856, 'duration': 0.6}, {'end': 796.714, 'text': "Okay, so it's just going to spin up our database.", 'start': 794.653, 'duration': 2.061}, {'end': 800.236, 'text': "So once this turns green, there it goes, it's all set.", 'start': 796.774, 'duration': 3.462}, {'end': 801.237, 'text': "So I'm going to click on it.", 'start': 800.256, 'duration': 0.981}, {'end': 807.921, 'text': 'And all we need to do here is set up a user, not like your MLAB user, but a user for the database.', 'start': 801.877, 'duration': 6.044}, {'end': 810.783, 'text': 'So click here and then add database user.', 'start': 807.941, 'duration': 2.842}, {'end': 811.983, 'text': "And I'm going to say ABC123.", 'start': 810.803, 'duration': 1.18}, {'end': 814.405, 'text': 'I think you have to have some numbers.', 'start': 812.103, 'duration': 2.302}, {'end': 821.309, 'text': 'I used to always just use Brad, but, you know, for tutorials, but now we have to use numbers.', 'start': 815.725, 'duration': 5.584}, {'end': 823.082, 'text': 'all right.', 'start': 822.822, 'duration': 0.26}, {'end': 826.403, 'text': "so we'll create that and now we have a database user.", 'start': 823.082, 'duration': 3.321}], 'summary': 'To work with mongodb, create a free database on mlab.com, then upgrade for production. chosen aws as cloud provider, set up database user.', 'duration': 108.058, 'max_score': 718.345, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw718345.jpg'}, {'end': 927.631, 'src': 'embed', 'start': 875.309, 'weight': 3, 'content': [{'end': 882.251, 'text': 'Okay So a sink away is just a more elegant way to handle asynchronous data to handle promises.', 'start': 875.309, 'duration': 6.942}, {'end': 884.911, 'text': "So we're going to use MongoDB.", 'start': 882.911, 'duration': 2}, {'end': 887.052, 'text': 'Okay The MongoDB driver.', 'start': 884.931, 'duration': 2.121}, {'end': 890.034, 'text': 'And then mongoclient.connect.', 'start': 887.572, 'duration': 2.462}, {'end': 892.736, 'text': "So that's used to just connect to your database.", 'start': 890.494, 'duration': 2.242}, {'end': 896.078, 'text': "That's going to take in your connection string, which I just copied.", 'start': 893.176, 'duration': 2.902}, {'end': 897.259, 'text': "I'm going to paste that in.", 'start': 896.098, 'duration': 1.161}, {'end': 901.082, 'text': 'And be sure to change the user and password to whatever you used.', 'start': 897.719, 'duration': 3.363}, {'end': 903.344, 'text': "So that's the user.", 'start': 902.443, 'duration': 0.901}, {'end': 904.384, 'text': 'This is the password.', 'start': 903.384, 'duration': 1}, {'end': 906.646, 'text': 'Make sure you replace the angle brackets as well.', 'start': 904.424, 'duration': 2.222}, {'end': 909.396, 'text': 'All right.', 'start': 909.096, 'duration': 0.3}, {'end': 918.624, 'text': 'And then one other thing I want to do here is pass a second parameter of an object and we want to say use new URL parser.', 'start': 909.496, 'duration': 9.128}, {'end': 920.985, 'text': "If we don't do this, we want to set this to true.", 'start': 918.684, 'duration': 2.301}, {'end': 922.987, 'text': "If we don't do this, it's going to throw an error.", 'start': 921.005, 'duration': 1.982}, {'end': 926.35, 'text': 'OK, not an error, but just like a warning.', 'start': 924.168, 'duration': 2.182}, {'end': 927.631, 'text': "And it's just annoying.", 'start': 926.57, 'duration': 1.061}], 'summary': 'Using mongodb driver to connect to database, with url parser for handling asynchronous data.', 'duration': 52.322, 'max_score': 875.309, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw875309.jpg'}], 'start': 718.345, 'title': 'Setting up databases on mlab and amazon web services', 'summary': 'Discusses setting up a mongodb database using mlab.com, emphasizing the free sign-up, different plans for development and production, and the inevitability of fees for popular production applications. it also covers the process of setting up a database on amazon web services, including selecting the cloud provider, configuring the database, creating a database user, and connecting to the database using mongodb driver and async functions.', 'chapters': [{'end': 775.17, 'start': 718.345, 'title': 'Setting up mongodb with mlab', 'summary': 'Discusses setting up a mongodb database using mlab.com, emphasizing the free sign-up, different plans for development and production, and the inevitability of fees for popular production applications.', 'duration': 56.825, 'highlights': ['Explaining the different plans for development and production, with the free sign-up option.', 'Emphasizing the inevitability of fees for hosting and storage for popular production applications.', 'Highlighting the option to create a new deployment on Mlab.com.']}, {'end': 927.631, 'start': 775.19, 'title': 'Setting up amazon web services database', 'summary': 'Covers the process of setting up a database on amazon web services, including selecting the cloud provider, configuring the database, creating a database user, and connecting to the database using mongodb driver and async functions.', 'duration': 152.441, 'highlights': ['The process of setting up a database on Amazon Web Services, including selecting the cloud provider, configuring the database, creating a database user, and connecting to the database using MongoDB driver and async functions. The chapter covers the process of setting up a database on Amazon Web Services, including selecting the cloud provider, configuring the database, creating a database user, and connecting to the database using MongoDB driver and async functions.', 'Using async functions and MongoDB driver to connect to the database and handle asynchronous data. The chapter explains using async functions and MongoDB driver to connect to the database and handle asynchronous data.', "The importance of specifying 'use new URL parser' as true when connecting to the database to avoid warnings. It emphasizes the importance of specifying 'use new URL parser' as true when connecting to the database to avoid warnings.", 'The process of creating a database user and the consideration of using numbers in the username. It details the process of creating a database user and the consideration of using numbers in the username.']}], 'duration': 209.286, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw718345.jpg', 'highlights': ['Emphasizing the inevitability of fees for hosting and storage for popular production applications.', 'Explaining the different plans for development and production, with the free sign-up option.', 'The process of setting up a database on Amazon Web Services, including selecting the cloud provider, configuring the database, creating a database user, and connecting to the database using MongoDB driver and async functions.', "The importance of specifying 'use new URL parser' as true when connecting to the database to avoid warnings.", 'The process of creating a database user and the consideration of using numbers in the username.', 'Highlighting the option to create a new deployment on Mlab.com.', 'Using async functions and MongoDB driver to connect to the database and handle asynchronous data.']}, {'end': 1153.237, 'segs': [{'end': 975.649, 'src': 'embed', 'start': 954.96, 'weight': 0, 'content': [{'end': 966.045, 'text': "OK, so this is just a function we're going to use within our routes to get the post collection so that we can run methods on it like inserts and deletes and gets and stuff like that or find.", 'start': 954.96, 'duration': 11.085}, {'end': 969.226, 'text': "So let's go back up to get posts.", 'start': 966.845, 'duration': 2.381}, {'end': 970.747, 'text': "We're going to get rid of this.", 'start': 969.766, 'duration': 0.981}, {'end': 973.348, 'text': "And I'm actually going to make this asynchronous.", 'start': 971.307, 'duration': 2.041}, {'end': 975.649, 'text': "OK, so I'm going to say a sync right here.", 'start': 973.688, 'duration': 1.961}], 'summary': 'Creating an asynchronous function to manipulate post collection in routes.', 'duration': 20.689, 'max_score': 954.96, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw954960.jpg'}, {'end': 1119.019, 'src': 'embed', 'start': 1014.073, 'weight': 1, 'content': [{'end': 1017.114, 'text': "And in here, I'm just going to put in a set of empty curly braces.", 'start': 1014.073, 'duration': 3.041}, {'end': 1023.717, 'text': 'This could be some kind of query, like if you want to search for, you know, text is is whatever, some string.', 'start': 1017.554, 'duration': 6.163}, {'end': 1025.416, 'text': 'But we want all the posts.', 'start': 1024.057, 'duration': 1.359}, {'end': 1028.858, 'text': 'OK, and then finally, we want to return it as an array.', 'start': 1026.077, 'duration': 2.781}, {'end': 1032.18, 'text': "So we're going to do to array like that.", 'start': 1028.877, 'duration': 3.303}, {'end': 1033.34, 'text': "And that's it.", 'start': 1032.84, 'duration': 0.5}, {'end': 1039.665, 'text': 'So that should give us that should return our posts with a 200 response.', 'start': 1033.881, 'duration': 5.784}, {'end': 1048.631, 'text': "So let's save this and let's go over to this route here, API post and reload and we get an empty array.", 'start': 1040.185, 'duration': 8.446}, {'end': 1050.353, 'text': 'All right.', 'start': 1050.032, 'duration': 0.321}, {'end': 1056.279, 'text': "So we're actually going to be using a tool called Postman, which makes HTTP requests.", 'start': 1050.513, 'duration': 5.766}, {'end': 1061.145, 'text': "If you want to use curl or some other tool that makes HTTP requests, that's fine.", 'start': 1056.339, 'duration': 4.806}, {'end': 1063.748, 'text': 'Let me just close all this stuff up.', 'start': 1062.006, 'duration': 1.742}, {'end': 1066.331, 'text': 'So this is Postman.', 'start': 1065.31, 'duration': 1.021}, {'end': 1068.494, 'text': 'You can just Google it, download it.', 'start': 1066.351, 'duration': 2.143}, {'end': 1071.458, 'text': "I'd highly recommend it if you're ever dealing with APIs.", 'start': 1068.514, 'duration': 2.944}, {'end': 1076.325, 'text': 'You can make all types of requests and put in your header values and all that stuff.', 'start': 1071.779, 'duration': 4.546}, {'end': 1078.448, 'text': 'So if I make a GET request to HTTP.', 'start': 1076.785, 'duration': 1.663}, {'end': 1087.867, 'text': 'localhost 5000 slash api slash post.', 'start': 1081.485, 'duration': 6.382}, {'end': 1090.688, 'text': "we're going to get the same thing, just an empty array.", 'start': 1087.867, 'duration': 2.821}, {'end': 1094.65, 'text': "we get a response of 200, which means everything's okay.", 'start': 1090.688, 'duration': 3.962}, {'end': 1099.811, 'text': 'but now what we want to do is create a route so that we can make a post request to actually add a post.', 'start': 1094.65, 'duration': 5.161}, {'end': 1105.729, 'text': "so let's go down here, Say router, since it's a post request, we want dot post.", 'start': 1099.811, 'duration': 5.918}, {'end': 1112.514, 'text': "And we're going to say slash because it's going to be to API slash post, just like here.", 'start': 1106.989, 'duration': 5.525}, {'end': 1116.036, 'text': "Although, you know, it's the same URL we're making the post.", 'start': 1112.854, 'duration': 3.182}, {'end': 1117.618, 'text': "I'm sorry, the request to.", 'start': 1116.477, 'duration': 1.141}, {'end': 1119.019, 'text': "But it's a different type.", 'start': 1117.918, 'duration': 1.101}], 'summary': 'Creating routes for get and post requests, returning 200 response with empty arrays.', 'duration': 104.946, 'max_score': 1014.073, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw1014073.jpg'}], 'start': 927.671, 'title': 'Using node.js express and postman for api requests', 'summary': 'Explains how to use a function to get the post collection in a node.js express application and demonstrates using postman for making http requests, including get and post requests, with a focus on api interaction.', 'chapters': [{'end': 1039.665, 'start': 927.671, 'title': 'Node.js express post collection', 'summary': 'Explains how to use a function to get the post collection in a node.js express application, including making the function asynchronous and using it to return an array of posts from the database with a 200 response.', 'duration': 111.994, 'highlights': ['The chapter explains how to use a function to get the post collection in a Node.js Express application. Node.js, Express, post collection', 'Making the function asynchronous and using it to return an array of posts from the database with a 200 response. asynchronous function, return array of posts, 200 response']}, {'end': 1153.237, 'start': 1040.185, 'title': 'Using postman for api requests', 'summary': 'Discusses using postman for making http requests to an api, demonstrating making a get request and setting up a route to make a post request, emphasizing the value of postman in dealing with apis.', 'duration': 113.052, 'highlights': ['The chapter discusses using Postman for making HTTP requests to an API The transcript highlights the use of Postman, a tool for making HTTP requests to an API, emphasizing its utility in dealing with APIs.', 'Setting up a route to make a POST request The transcript explains the process of creating a route to handle a POST request to add a post, demonstrating the practical implementation of making a POST request to the API.', 'Emphasizing the value of Postman in dealing with APIs The transcript emphasizes the importance of Postman in dealing with APIs and recommends its use, indicating its value in making various types of requests and managing header values.']}], 'duration': 225.566, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw927671.jpg', 'highlights': ['The chapter explains how to use a function to get the post collection in a Node.js Express application. Node.js, Express, post collection', 'Making the function asynchronous and using it to return an array of posts from the database with a 200 response. asynchronous function, return array of posts, 200 response', 'The chapter discusses using Postman for making HTTP requests to an API The transcript highlights the use of Postman, a tool for making HTTP requests to an API, emphasizing its utility in dealing with APIs.', 'Setting up a route to make a POST request The transcript explains the process of creating a route to handle a POST request to add a post, demonstrating the practical implementation of making a POST request to the API.', 'Emphasizing the value of Postman in dealing with APIs The transcript emphasizes the importance of Postman in dealing with APIs and recommends its use, indicating its value in making various types of requests and managing header values.']}, {'end': 1529.21, 'segs': [{'end': 1207.93, 'src': 'embed', 'start': 1153.277, 'weight': 0, 'content': [{'end': 1154.618, 'text': 'It inserts one record.', 'start': 1153.277, 'duration': 1.341}, {'end': 1168.129, 'text': "So in here, we're going to pass in an object, and we want text, which is going to come from request.body.text using the body parser.", 'start': 1156.545, 'duration': 11.584}, {'end': 1174.811, 'text': "And then we also want to have a created at, which is we're just going to say new date by default.", 'start': 1168.789, 'duration': 6.022}, {'end': 1182.956, 'text': "Okay, and then finally we want to return a HTTP response, and I'm going to return a 201.", 'start': 1175.871, 'duration': 7.085}, {'end': 1188.4, 'text': 'Okay, 201 means everything went okay, but it also means something was created.', 'start': 1182.956, 'duration': 5.444}, {'end': 1196.386, 'text': "So we're going to do res.status, and status is going to be 201, and we want to do .", 'start': 1188.42, 'duration': 7.966}, {'end': 1198.587, 'text': "send And that's it.", 'start': 1196.386, 'duration': 2.201}, {'end': 1199.668, 'text': "Let's save that.", 'start': 1198.847, 'duration': 0.821}, {'end': 1202.59, 'text': "And now we'll go and try to add a post through postman.", 'start': 1200.349, 'duration': 2.241}, {'end': 1207.93, 'text': "so i'm going to open up a new tab here and say post.", 'start': 1204.787, 'duration': 3.143}], 'summary': 'Creates a record with text and timestamp, returns 201 status.', 'duration': 54.653, 'max_score': 1153.277, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw1153277.jpg'}, {'end': 1234.173, 'src': 'heatmap', 'start': 1207.93, 'weight': 0.839, 'content': [{'end': 1214.537, 'text': "i'm going to grab this same url, though, and there's a couple things we need to do in headers.", 'start': 1207.93, 'duration': 6.607}, {'end': 1222.605, 'text': "we need to give it the content type, which is going to be application slash json, and then we'll go to body.", 'start': 1214.537, 'duration': 8.068}, {'end': 1224.327, 'text': 'this is where we add the data.', 'start': 1222.605, 'duration': 1.722}, {'end': 1228.23, 'text': "i'm going to hit raw and then just put in some raw json, All right.", 'start': 1224.327, 'duration': 3.903}, {'end': 1230.611, 'text': 'Ultimately, this is going to come from Vue.js.', 'start': 1228.33, 'duration': 2.281}, {'end': 1234.173, 'text': "But right now we don't have this is just like a headless server.", 'start': 1230.651, 'duration': 3.522}], 'summary': 'Configuring headers and sending raw json data for vue.js integration.', 'duration': 26.243, 'max_score': 1207.93, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw1207930.jpg'}, {'end': 1314.925, 'src': 'embed', 'start': 1284.996, 'weight': 4, 'content': [{'end': 1287.178, 'text': 'which is whatever the current date and time is.', 'start': 1284.996, 'duration': 2.182}, {'end': 1290.481, 'text': 'All right, so we know our API is working so far.', 'start': 1288.039, 'duration': 2.442}, {'end': 1293.845, 'text': "Now let's do the delete request.", 'start': 1291.002, 'duration': 2.843}, {'end': 1296.027, 'text': "Okay, so we'll say router.delete.", 'start': 1293.965, 'duration': 2.062}, {'end': 1302.233, 'text': 'And this is going to take in our route.', 'start': 1299.089, 'duration': 3.144}, {'end': 1305.676, 'text': 'Now, with delete, we need a specific post to delete.', 'start': 1302.273, 'duration': 3.403}, {'end': 1307.898, 'text': "We're going to send that along in the URL.", 'start': 1306.016, 'duration': 1.882}, {'end': 1314.925, 'text': "So we're going to say colon or actually slash colon ID, which is going to represent whatever the ID is.", 'start': 1307.918, 'duration': 7.007}], 'summary': 'Developing api to handle delete requests with specific post ids.', 'duration': 29.929, 'max_score': 1284.996, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw1284996.jpg'}, {'end': 1499.904, 'src': 'embed', 'start': 1451.19, 'weight': 3, 'content': [{'end': 1452.791, 'text': "so let's go ahead and try that.", 'start': 1451.19, 'duration': 1.601}, {'end': 1455.233, 'text': 'okay, we get a 200 response.', 'start': 1452.791, 'duration': 2.442}, {'end': 1457.294, 'text': 'you can see right here under status.', 'start': 1455.233, 'duration': 2.061}, {'end': 1461.837, 'text': 'and now, if i go back to our get request and send it again, that request is now.', 'start': 1457.294, 'duration': 4.543}, {'end': 1464.7, 'text': "i'm sorry, that post is now deleted.", 'start': 1461.837, 'duration': 2.863}, {'end': 1469.103, 'text': 'okay, so now we have all of our routes, we have all of our functionality.', 'start': 1464.7, 'duration': 4.403}, {'end': 1474.066, 'text': "um, i think I think we're all set for the back end.", 'start': 1469.103, 'duration': 4.963}, {'end': 1479.91, 'text': "It's a very simple API, but again, the goal here isn't to build some amazing application.", 'start': 1474.126, 'duration': 5.784}, {'end': 1485.314, 'text': "It's to show you how to put things together, and you can take that, and you can build bigger things if you want.", 'start': 1479.97, 'duration': 5.344}, {'end': 1487.635, 'text': "So I think we're all set.", 'start': 1486.314, 'duration': 1.321}, {'end': 1490.817, 'text': 'We will have to do some additional stuff before deployment.', 'start': 1487.675, 'duration': 3.142}, {'end': 1494.98, 'text': 'Actually, I guess we could do that now.', 'start': 1492.298, 'duration': 2.682}, {'end': 1499.904, 'text': 'Do I want to do that now?', 'start': 1498.983, 'duration': 0.921}], 'summary': 'Backend setup completed, ready for deployment.', 'duration': 48.714, 'max_score': 1451.19, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw1451190.jpg'}], 'start': 1153.277, 'title': 'Building a simple api with node.js and mongodb', 'summary': 'Discusses inserting a record with text obtained from request.body.text, adding a created at timestamp, and returning a 201 http response. it also demonstrates building a simple api with node.js and mongodb, achieving successful 200 responses for creating, retrieving, and deleting data.', 'chapters': [{'end': 1207.93, 'start': 1153.277, 'title': 'Insert record and handle http response', 'summary': 'Discusses inserting a record by passing an object with text obtained from request.body.text, adding a created at timestamp, and returning a 201 http response to indicate successful creation of the record.', 'duration': 54.653, 'highlights': ['The chapter demonstrates inserting a record by passing an object with text obtained from request.body.text.', 'The chapter covers adding a created at timestamp to the record by default as a new date.', 'The chapter emphasizes returning a 201 HTTP response to indicate successful creation of the record.']}, {'end': 1529.21, 'start': 1207.93, 'title': 'Building a simple api with node.js and mongodb', 'summary': 'Demonstrates building a simple api with node.js and mongodb, including creating, retrieving, and deleting data, and testing it using postman, achieving a successful 200 response for creating, retrieving, and deleting data.', 'duration': 321.28, 'highlights': ['The API is tested using Postman, achieving a successful 200 response for creating, retrieving, and deleting data.', 'The API functionality includes creating, retrieving, and deleting data, with successful testing using Postman.', 'The chapter explains the process of building a simple API with Node.js and MongoDB, covering creating, retrieving, and deleting data, and testing it using Postman.', 'The API is built with Node.js and MongoDB, allowing the creation, retrieval, and deletion of data, and successful testing using Postman.', 'The chapter demonstrates creating, retrieving, and deleting data through the API, successfully testing it using Postman and achieving a 200 response.']}], 'duration': 375.933, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/j55fHUJqtyw/pics/j55fHUJqtyw1153277.jpg', 'highlights': ['The chapter demonstrates inserting a record by passing an object with text obtained from request.body.text.', 'The chapter covers adding a created at timestamp to the record by default as a new date.', 'The chapter emphasizes returning a 201 HTTP response to indicate successful creation of the record.', 'The chapter explains the process of building a simple API with Node.js and MongoDB, covering creating, retrieving, and deleting data, and testing it using Postman.', 'The API is built with Node.js and MongoDB, allowing the creation, retrieval, and deletion of data, and successful testing using Postman.', 'The API is tested using Postman, achieving a successful 200 response for creating, retrieving, and deleting data.']}], 'highlights': ['The chapter explains how to use a function to get the post collection in a Node.js Express application. Node.js, Express, post collection', 'The chapter discusses using Postman for making HTTP requests to an API The transcript highlights the use of Postman, a tool for making HTTP requests to an API, emphasizing its utility in dealing with APIs.', 'The chapter demonstrates inserting a record by passing an object with text obtained from request.body.text.', 'The chapter covers adding a created at timestamp to the record by default as a new date.', 'The chapter emphasizes returning a 201 HTTP response to indicate successful creation of the record.', 'The chapter explains the process of building a simple API with Node.js and MongoDB, covering creating, retrieving, and deleting data, and testing it using Postman.', 'The API is built with Node.js and MongoDB, allowing the creation, retrieval, and deletion of data, and successful testing using Postman.', 'The API is tested using Postman, achieving a successful 200 response for creating, retrieving, and deleting data.', 'The chapter focuses on creating the Express API and setting up the server, emphasizing the integration of backend API with Vue.js, and deploying to Heroku.', 'The chapter discusses the installation of essential dependencies including Express, Cors, Body-Parser, MongoDB, and Nodemon for the server, with the aim of facilitating smooth server operations.', 'Recommendations for Essential Tools and Dependencies The chapter provides recommendations for essential tools such as VS Code extensions and dependencies including View Tooling and Prettier, facilitating an efficient development environment.', 'Emphasizing the inevitability of fees for hosting and storage for popular production applications.', 'Explaining the different plans for development and production, with the free sign-up option.', 'The process of setting up a database on Amazon Web Services, including selecting the cloud provider, configuring the database, creating a database user, and connecting to the database using MongoDB driver and async functions.', "The importance of specifying 'use new URL parser' as true when connecting to the database to avoid warnings.", 'The process of creating a database user and the consideration of using numbers in the username.', 'Highlighting the option to create a new deployment on Mlab.com.', 'Using async functions and MongoDB driver to connect to the database and handle asynchronous data.']}