This tool informs the user when a new create-react-app version releases using email and slack.
npm install
npm start
Note: Always run this app in dev mode. Production Github API takes only a restricted number of hits from one IP address. Running too many times in prod mode will exhaust the number of hits and the app will stop working.
npm run dev
- config/credentials.js.example to config/credentials.js
- Add sender's credentials
username: "yourEmailAddress@gmail.com"
- Password must be escaped. Use this tool to escape your password Escape Tool Password must be served through the environment variable GMAIL_PASSWORD
"dev": "cross-env NODE_ENV=development GMAIL_PASSWORD=yourPassword node server.js"
- Slack API Token must be served through the environment variable SLACK_API_TOKEN
"start": "cross-env NODE_ENV=development GMAIL_PASSWORD=yourPassword SLACK_API_TOKEN=xxxxxxxSlackAPITokenxxxxxx node server.js",
- Add emails to recipients
recipients: [
"yourEmailAddress@gmail.com",
"anotherEmailAddress@gmail.com"
],
errorRecipients: ["youremailaddress@gmail.com", "anotherEmailAddress@gmail.com"]
- config/config.js
- Supply new demo API URL, create a demo API, for example, using jsonblob.com
- copy API data from prod URL
https://api.github.com/repos/facebook/create-react-app/releases/latest
dev_URL: "https://jsonblob.com/api/f13430d8-d313-11ea-bb09-433dc46d1195"
Logs are made at
/quick-start-combined.log
/quick-start-error.log
- Never commit crendtials.js, use the below method to configure git to always ignore credentials.js
https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally
npm install pm2 -g
For windows, make a script
startNewsTool.bat
pushd "E:\nodejsCrud"
pm2 start server.js --name news-tool --time --log "E:\nodejsCrud\logs.txt"
exit
-
change the cd address in the below command to the local location of the project
-
change the log address to an empty server Log text file
For macOS / Ubuntu, make a script
startNewsTool.sh
pm2 start /home/paras/Desktop/news-alerts/server.js --name news-tool --time --log "/home/paras/pm2-logs/logs.txt"
To monitor the status of the service deployed, open PM2 Dashboard
pm2 monit