Show Menu
Cheatography

Heroku Nodejs Postgres Cheat Sheet by

Some commands for Heroku

Utils

heroku version
Version
heroku login
Login
heroku create [appName]
Create app
heroku rename [newName]
Rename app

Server

heroky logs -t
Show logs
heroku config:set PORT=3000
Create env variable
heroku config
Show env
heroku run bash
Runs bash in an off-dyno
heroku open graphql
Open server webpage to /graphql
heroku ps:scale web=0
Stop all the dynos
heroku ps:scale web=1
Start a dyno
heroku restart
Restart the app

Database

heroku addons­:create heroku­-po­stg­res­ql:­hob­by-dev --vers­ion=12
Create an addon
heroku addons­:docs heroku­-po­stg­resql
Addon's docume­ntation
heroku pg:wait
Wait pg is running
cat databa­se/­ini­t_d­ata­bas­e.sql | heroku pg:psql
Init Database
heroku pg:info
Info Database usage

heroku pg:psql

\dt+
Show tables
SELECT * FROM "­Use­r";
Show all users
SELECT * FROM user;
Show postgre user
GRANT [userName] to postgres
Grant userName to postgres (not used)

Git

heroku git:remote -a [appName]
App heroku remote to project
git subtree push --prefix my-dir heroku main
Push a specific folder to heroku main branch
git subtree split -P my-dir -b my-dir­-branch
Creates a new branch with only the specified folder

Frontend

HOSTNA­ME=­[ap­pNa­me].he­rok­yap­p.com
Set HOSTNAME in front

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.