This course has been updated! We now recommend you take the API Design in Node.js, v4 course.

Check out a free preview of the full API Design in Node.js, v3 course:
The "Express" Lesson is part of the full, API Design in Node.js, v3 course featured in this preview video. Here's what you'd learn in this lesson:

Scott introduces the most popular framework for building APIs in Node.js.

Get Unlimited Access Now

Transcript from the "Express" Lesson

>> Scott Moss: So Express, anybody here use Express before? All right, Nate, you said you used Express. What did you build with Express before?
>> Speaker 2: Ooh, let's see, I've built a collaborative drawing app. It's basically a, it's like a little drawing game where you start a picture and send it to a friend.

[00:00:23] And they can only see a clue of the picture, and they have to finish it. We used Express to build the different routes to send image data back and forth from the Mongo database.
>> Scott Moss: That's awesome. So without Express, how difficult do you think it would have been to build that API?

>> Speaker 2: Tooth pullingly difficult.
>> Scott Moss: [LAUGH] Yeah, that's right. And that's because Express is basically like the standard API for Node.js. Without Express, you could totally build an API. No, like, Express is not like something that implements APIs for Node. It just makes it easier. Node has the ability to create its own APIs with its own internal modules.

[00:01:04] It's just that it's really difficult to do. I don't wanna say it's lower-level, because there's definitely lower level implementations of building APIs in other languages. But when compared to just like what you can do in Node, it's pretty low level as far as like what you need to do.

[00:01:20] And yeah, you can totally do it. But I highly recommend not doing it because you'll just be building your own Express at the end of the day. So you might as well just use something that somebody else already made and maintains. So it handles all the tedious tasks, like managing sockets, route matching, which is a big one, error handling, which is very sneaky in Node cuz it's single threaded.

[00:01:42] And a lot more, like delegating to controllers, handling async execution, all types of things.
>> Scott Moss: It is open source so you can just use it, you can contribute to it, it's pretty awesome. It has a huge community and support from anything that has to do with APIs and Node.js.

[00:02:00] So basically what I'm saying is, if there is a plugin or a library that you wanna use in your API, if they, if that maintainer wants their project to be used they most likely made it compatible with Express. Cuz they know everybody uses Express. So chances are the thing that you wanna use is compatible with Express, if it's an API plugin or something like that.

[00:02:20] For instance, if you need it to add rate limiting to your API and you wanted to do it on that level, yeah, chances are if you go look, NPM rate limiting, it's gonna be compatible with Express. Not saying you should be doing rate limiting on Express. You should do that higher level somewhere else.

[00:02:35] But yeah, it's gonna be compatible. Any questions?
>> Scott Moss: Nope, okay yeah, and it's not going anywhere any time soon. It's like on version four and it's still being upgraded, still being maintained, so it'll be here.