In this video, Emmanuel Henri explores other potential options for creating APIs beyond a simple Node Express combination. He looks at koajs, loopback and swagger.
- [Instructor] We've build an API with endpoints from scratch using Express in this course however there are other libraries worth exploring if you want to save some time or get more benefits from these libraries. I always think it's great to first build one on your own so you can learn the basics and the syntax then borrow from other libraries to be more efficient. Here are some of the potential options. First go to koajs.com If you like Express but would like to get more for less Koa is a great option built from the same people who did Express.
For instance, if you're familiar with ES6 syntax you can use generators instead of callbacks. They also remove middleware to make the library smaller and there is much more to explore. Feel free to take a look at it. Then got to swagger.io and also loopback.io then if you'd like to get a full fledged prebuilt API you could either use Swagger or LoopBack which both come prebuilt with all the endpoints you need once you set a few things.
I haven't worked with Swagger but I've build a few projects using LoopBack and I can tell you it's a very good API generator where you can easily build a back end server with all your API endpoints with a few CLI commands. So feel free to explore these tools at your own leisure. But the beauty of having built one yourself from scratch is that it'll make it easier for you to understand and compare what they offer.
- Setting up a project and a server
- Setting up a database and schema
- Creating POST, GET, PUT, and DELETE endpoints
- Serving files