Mern App with Auth Management
cmd: npm init -y // generate package.json file /n
The Witch bade her clean the pots and kettles and sweep the floor and keep the fire fed with wood.
Step-2: create api folder(this folder means backend folder). Under api folder create server.js file.
cmd: npx create-react-app social // here socail is a react app name
cmd: npm install express nodemon dotenv colors mongoose multer jsonwebtoken bcryptjs
SERVER_PORT = 5050
import express from "express";
import colors from "colors";
import dotenv from "dotenv";
// initialize express
const app = express();
dotenv.config();
// initialize enviornment variable
const PORT = process.env.SERVER_PORT || 5000;
//listen server
app.listen(PORT, () => {
console.log(`server running on port ${ PORT }`.bgGreen.black);
});
cmd: npm install concurrently -D
"start": "concurrently "npm run server" "npm run social"", \here social is a react app name
npm run start