Skip to content

Instantly share code, notes, and snippets.

@fega
Last active December 23, 2018 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fega/e3643393552f18b46511fb23cb192986 to your computer and use it in GitHub Desktop.
Save fega/e3643393552f18b46511fb23cb192986 to your computer and use it in GitHub Desktop.
Quick deploy moser to Heroku
# in the folder
# Create the config file
module.exports{
port: process.env.PORT || 3000,
db: process.env.MONGO_URI
}
# Create package.json
npm init -y
git init
# Add start script to package.json
npm i -g json
npm i -S moser
json -I -f package.json -e 'this.scripts["start"]="npm run build"'
# CREATE Procfile
echo 'web: npm run start' > Procfile
# Create Heroku app
heroku create
# Add MongoDb Add-on
heroku addons:create mongolab:sandbox
# Commit changes
git add .
git commit -m "First commit"
git push heroku master
# deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment