- Express
- jsonwebtoken
- bcrypt
- bcryptjs
- dotenv
- moment
- mongoose
- nodemon
- MongoDB
- Node Server
- Testing
- Deployment in Heroku
- Heroku
- Git
- MongoDB - Google Link With mrmezan0@gmail.com
-
Server.js
- [x] Below is the configuration for Heroku After Your Route
if(process.env.NODE_ENV === 'production') { app.use(express.static('client/build')); app.get('*', (req, res) => { res.sendFile(path.resolve(__dirname, 'client', 'build', 'index.html')); } ); } const port = process.env.PORT || 5000; app.get('/', (req, res) => res.send('Hello World!'));
-
package.json
- Below is the configuration for Heroku After
"main": "index.js",
"engines": { "node": "17.8.0", "npm": "8.13.2" }, "scripts": { "client-install": "npm install --prefix client", "server": "nodemon server.js", "client": "npm start --prefix client", "dev": "concurrently \"npm run server\" \"npm run client\"", "start": "node server.js", "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client" },
- gitignore
-
node_modules
- If in gitignore .env is also is listed then remove from it otherwise MONGO_URL can't be found
-
- Clone the repository
- Install the dependencies
- npm install
- Set up .env
- MONGO_URI=
YOUR_MONGO_URL\DATABASE_NAME
- JWT_SECRET=
YOUR_JWT_SECRET
- If Local MONGO_URI=
mongodb://127.0.0.1:27017/doctor-appointment
- MONGO_URI=
- Run the server
- nodemon server
- Run the tests
- Deploy the server
/* Extra small devices (phones, 600px and down) */ @media only screen and (max-width: 600px) {...} /* Small devices (portrait tablets and large phones, 600px and up) */ @media only screen and (min-width: 600px) {...} /* Medium devices (landscape tablets, 768px and up) */ @media only screen and (min-width: 768px) {...} /* Large devices (laptops/desktops, 992px and up) */ @media only screen and (min-width: 992px) {...} /* Extra large devices (large laptops and desktops, 1200px and up) */ @media only screen and (min-width: 1200px) {...}
-
nodemon server
-
cd client
-
npm start