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 :: react router lazy load 
Javascript :: javascript console.table 
Javascript :: deploy react app 
Javascript :: how to generate a new page component in angular 
Javascript :: html to pdf nodejs 
Javascript :: using regex in javascript 
Javascript :: html content in jspdf 
Javascript :: javascript interview questions for freshers 
Javascript :: js select keys from object 
Javascript :: jQuery Effects - Fading 
Javascript :: reverse integer in javascript 
Javascript :: javascript style guide 
Javascript :: patterns in javascript 
Javascript :: append to map javascript 
Javascript :: change text shadow javascript 
Javascript :: owl timeout loop 
Javascript :: get request with axios 
Javascript :: how to check if input is string javascript 
Javascript :: javascript convert timezone name to abbreviation 
Javascript :: js binary 
Javascript :: nestjs allow origin 
Javascript :: jasmine sample code 
Javascript :: javascript get distance between months 
Javascript :: javascript get tag child elements 
Javascript :: how to push key value pair to object javascript 
Javascript :: dynamic search bar javascript 
Javascript :: uncheck multiple checkboxes javascript 
Javascript :: javascript beginner 
Javascript :: react useMemo to render a list 
Javascript :: populate example in mongoose 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =