Making APIs that requires photos, so uploading photos to the Amazon S3 bucket and accessing it with the public url is one way and then we can save that public url in our MongoDB database for further retrieval.

Prerequisites before starting


Easily deploying a web app made with React, Node.js, Express, and MongoDB on Heroku by using a post-build script and connecting it with GitHub for automatic deployment of the app.

Small Introduction to the MERN Stack and Heroku

MERN is an acronym for a JavaScript web app made using: React (for the frontend UI part), Node.js and Express (for the backend, managing APIs for the app), MongoDB (for storing the data). Right now, it is a very famous web stack for making full-stack projects because of its ease to develop a full-fledged application.

Heroku is a PaaS(Platform As A Service) software used to deploy applications. Now it supports…


Part 2. Making API endpoints to post or retrieve data

In this article you will get to know how endpoints are made to do CRUD (Create, Read, Update, Delete) operation on data stored on MongoDB Atlas database using Rest-API.

In the above article we saw how to setup the Node.js project and connect our MongoDB database to the Node.js. Now we will start with making api endpoints.

1. Firstly we have to make schema of the type of data that we want in our API, we will make the schema for products in the shop

Make a folder in the main directory names models and make a file named Products.js and the following code.

const mongoose = require('mongoose') // required to make the schemaconst ProductSchema = mongoose.Schema({
name: {
type: String…


Part 1. Server connection setup

In this post, you will understand what is a REST API and learn how to make the connection setup for the API in Node.js with MongoDB Atlas.

By: umang

Firstly, what is Restful API?

REST(REpresentational State Transfer) is an architectural style or pattern that defines the set of constraints for developing web applications. Restful APIs are a way of accessing the data or services in a simpler way.

When a request is made to the endpoint, it transfers the representation of the state of resources to the endpoint, and the response is given back in one of these formats: JSON (most commonly used), HTML, PHP, Xlt, or…


By -: Umang Agrawal

VSCode is one of the best and most powerful editors with Intellisense technology. Everyone loves to use VSCode. So why not make it more powerful and helpful by adding extensions made by brilliant developers that really make development easier? Not only that, but they also save our development time and make us more productive. They would help you in becoming a better programmer.

Mostly all developers use git and GitHub for pushing their code to a remote repository or for collaboration on a project with a team. …


All the necessary commands use to deploy will be there in this article.

Prerequisites

Important lines of code to check before moving ahead.

(Find you node version by typing node --version in command prompt)

"engines": {
"node": "14.X"
}

2. specify the start command in the package.json file-: ex nodemon, nodemon server.js, npm start, etc.

"scripts": {
"start": "nodemon server.js"
}

(From 2013 procfile is not necessary for node app and it…

Umang Agrawal

Umang is a developer, tech enthusiast, and a photographer. Loves to code with coffee on desk.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store