A REST API is an integral component of a web application. You don't need to be an expert backend developer to make your own. In this workshop, we will walk through the basic building blocks of creating your own REST API using Node.js, Express, and MongoDB.
Pre-requisites
If you would like to follow along, please download and install the following:
- Node.js (LTS 8.x)
- Robo3T (Lightweight GUI for MongoDB)
- Create a free MongoDB instance on mLab
- Insomnia REST Client
- IDE Suggestions: Visual Studio Code, Atom, WebStorm (Trial/Paid)
Links
Top comments (4)
Hello Nick, everytime I click on the link it opens your react tutorial.
This is the Node/Mongo API video's link : Link to video on Nick's youtube channel
Thank you so much for catching that @robencom ! I have been sharing that React link way too much lately. :D
Here's the updated link: youtu.be/egeHq-lYyxoa
Thanks for sharing! Very interesting, I've written a ton of APIs, but never in javascript before. Has using a (No)SQL database through javascript reached a decent enough maturity level to be seen as a production alternative for existing languages like C# in your opinion?
By the way, while looking through your code on github, I noticed you committed the database credentials. I'm not sure if you are aware of that, since your database seems to be open to anybody that finds these credentials.
That database I shared is an isolated sandbox instance on mLab, so I left the credentials in the code in case anyone wants to play with it. Thanks for pointing that out.
I've coded in ~13 languages and built large-scale systems in a handful of them. My favorites have been C++, C# and Python. Over the past two years, I have worked exclusively with the MERN stack. It is such a joy to work with that stack and it makes life so much easier compared to any other language I've used. The best thing is that you stay within the JS ecosystem all the way to the database. I've built about five large-scale applications using Node / Express / Mongo and haven't had any issues. I had to learn the ropes to deal with lack of multi-threading and scaling, etc.
If your server-side computations are CPU intensive, you need to architect your project accordingly. In those cases, I might opt for Python / C# / C++.