DEV Community


Posted on • Updated on

MERN stack project deployment steps to Netlify

If you are still having a lot of issues to deploy in firebase you can also deploy to netlify. Netlify deploy for a react project is far easy for you. Right? Follow this link: Just 3 steps:

Step-1: Go the public folder in your project. create a file called _redirects . Copy & paste the following the code inside the _redirects file, then save.

/* /index.html 200

Step-2: Create dist folder in the root directory for your project. [Root directory is the path where your package.json locates] giving the following command.

npm run build

Step-3: Sign in to netlify. Go to sites. Scroll down, drag & drop your dist folder.

Image description

Step-4: The last but most important part for working firebase authentication system properly : (if you don't have any authentication system in your project, then you can skip it.)

  • Go to Firebase Console
  • Click Authentication Menu > Settings tab
  • Scroll Down to Authorized domains
  • Click "Add domain" button, add your netlify deployed url and click "Add"

Image description

Bingo!! That's all!!!

Top comments (1)

sajalbiswas1 profile image
Sajal Biswas

Thank you