sudo mkdir -p /path/www/domainaname/folderName => To create folders and nested folders in the given pathcd /etc/apache2/sites-available/ => Virtual Hostvim fileName => Edit file and Save & Exitcp folderName folderName.confsudo a2ensite folderName => To enable foldersudo service nginx restartsudo apt-get install certbotheroku --version => Checkheroku login => Will open Browserconst PORT = process.env.PORT || 5000 => Add this Port in the backend App so that Heroku can give any available Portconst mongoURI = process.env.MONGODB_URI || "yourString" => Add this for mongoose.connect functionif (process.env.NODE_ENV === "production") {
app.use(express.static("folderPath"));
}
"start": "node index.js" => Helps Heroku runs the server file if needed"build": "cd path && npm run build" => So that Build process runs when App is on cloud"processName": "cd path && npm install" => Installs npm modules before running above command"heroku-postbuild": "npm run processName && npm run build" => In built heroku function that will run the above two commands in orderrm -rf .git => Removes .git folder, Go to that folder and run this command, Subfolders should not have .git foldergit init => Initialize git in the root foldergit status => Check which files are selected to uploadheroku create appName => Creates your Appheroku addons:create mongolab:sandbox => This will add this Add-onheroku addons --all => Your created app should be under Owning App columngit add -A => Add everything to Gitgit commit -m "yourMessage" => Commit to Githeroku local => Runs your App locally as it would in Herokugit push heroku master => Push to Herokuheroku open => Open the App in Browsergit remote add origin repoSShgit remote -v => Check if connectedgit push origin master => Push to GitHub