Discover how to design, build, test, and deploy a RESTful API using Node.js and Mongo. Learn about data modeling, querying data with Mongoose, using JSON Web Token, and more.
- (upbeat music) - So let's just hop right into it then.
Everybody should have the link for this. So these are going to be like our notes or like our slides. I don't like to use actual slides, because I'm just like worn out on slides. So I just made a website with the notes on it and that's what we're going to use. And this'll be here forever. And I'll probably add this to the Read Me on the GitHub read me so you can look at it. So this is where we'll do our learnings and then we'll have an app that we'll be building. And then as far as the app, the repo is going to be here. If you haven't got this go ahead and fork it or clone it or whatever your process is for gettin' your repos.
Cool, so also I want to let you all know to like, if you have a question here on site, like just ask me. Don't feel like you have to wait 'til the end. Just like, I want this to be open. Ask you as many questions as you want. Don't feel like you're slowin' me down and online if you're joining us, just hit up Mark with a K on the channel and just ask him and he'll either answer it himself or he'll ask me. So, just feel free to ask as many questions as you can. If you think I made a mistake or if you didn't quite understand what I said, don't let it go by. Just totally ask me.
Great, so... What are we going to be doing for these next three days in this workshop? Well like I said, it's going to be around designing APIs with node and Mongo and how all that works. So, not only are we going to be learning how to design this stuff, but we're also going to be building it of course. We're going to learn how to test it and we're going to be deploying it, which makes sense. It wouldn't really be fair if showed you how to design an API and not how to do the rest of that stuff. That just, it wouldn't be fair. I wouldn't be settin' you up for anything practical.
So as far as like the application itself, you will not be building that. We've actually built that on another workshop. So that's built for you, the front end, the client, you'll just be building the server part for it. So don't worry about, you know, messin' around with the actually web app. We won't be buildin' that. Cool, any questions so far? All right. So let's just like, do like a quick refresher on node. Who in here has experience with node? Let me see hands. Okay, little bit, little bit, none, okay.
So that's the newer way to build your libraries. So that's like the thing that people are startin' to do now, but if you download something that isn't like that, somethin' that's like attached to the window and you try to run it in node, you're probably going to get an error, so you can chase the errors and figure out the polyfill yourself or you know, just convert it to node yourself and see what happens but, yeah there are some polyfills that do exist. But people are movin' away from that. So if you were to install node you will also notice that you get something called NPM.
It's very similar to that, but just in my opinion a lot easier to use. So the way NPM works, like I said it comes bundled up with your installation of node. It uses this file called a package.json to store like metadata about your packages and what packages your package may need. So it just like reads that file, depending on the command you give it, and that's how it knows what to install, what to uninstall, what to update. It's just a file. So yeah, NPM is the standard. There really aren't any other package managers you would use with node.
But they are two separate entities. NPM is its own entity, node is its own entity, they just happen to be workin' together, because they just work that way. So yeah, you'll see a lot of, everything we do as far as dependency management will be through NPM. There are other package managers out there like Bower and stuff like that, but Bower is a node module that you have install with NPM and that's more for client side dependencies. So it's still all through NPM. So all third party modules, when downloaded, will be placed in the node_modules directory by default.
So we use NPM to go download something, if there isn't already a node modules directory at the root of our application, one will be created and that's where all of our node_modules will be placed by default, in a node_modules folder.
This course was created by Frontend Masters. It was originally released on 12/30/2015. We're pleased to host this training in our library.
- Executing Node.js
- Using Express
- What is middleware?
- Testing in Node.js
- Using Mongo with Node.js
- Data modeling
- Querying data with Mongoose
- Identifying sensitive routes
- Configuring the deployment