Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Deploying Node.js Apps on Heroku

1- Specify the version of node on package.json
	"engines": {
    "node": "14.x"
  },
npm install
heroku local web
	Your app should now be running on http://localhost:5000/. 

echo "/node_modules

npm-debug.log

.DS_Store

/*.env" >  .gitignore

*/
git add .
git commit -m "Added a Procfile."
heroku login
heroku create
git push heroku main

    
    
Comment

deploy node app to heroku

Prequisite:-

try npm run build to check if build script works or not locally.

server.js is present endpoint.

package.json
{
  "name": "server",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "test": "echo "Error: no test specified" && exit 1",
    "server": "nodemon server.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
  ...
  },
  "devDependencies": {
   ...
  }
}
    


Open Heroku.
Connect to git repo.
Press Deploy Btn.
Comment

PREVIOUS NEXT
Code Example
Javascript :: short-circuit evaluation javascript 
Javascript :: nodejs input 
Javascript :: instanceof 
Javascript :: make indexOF in js 
Javascript :: javascript event 
Javascript :: json.stringify file object return {} 
Javascript :: how to change port in next js 
Javascript :: ReferenceError: document is not defined 
Javascript :: add new element by index js 
Javascript :: array filter with multiple conditions 
Javascript :: dispatch store 
Javascript :: how to link to a different component in reactjs without react router 
Javascript :: get js 
Javascript :: js array modify element 
Javascript :: empty array 
Javascript :: usestate in react 
Javascript :: javascript debugging 
Javascript :: objects in javascript 
Javascript :: jq cheat sheet 
Javascript :: ex:js 
Javascript :: npx for yarn 
Javascript :: timer javascript 
Javascript :: status discored jks 
Javascript :: GTM Qgiv 
Javascript :: jquery ui dialog live cdn 
Javascript :: js let vs var performance 
Javascript :: all navigator CPU option in javascript 
Javascript :: google-maps-react give undefined lat long 
Javascript :: excluding a attribute from json strigify 
Javascript :: angular check if array is empty 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =