service: heroku
How to start?
Heroku my page
Work Directory
install heroku
add your heroku remote as suggested
heroku git:remote -a dwitter-ym
push
~~git push sequelize-deploy:master~~
git push heroku HEAD:master
ex: git push heroku sequelize-deploy:master
log
heroku logs --tail --app avatar
Postgress Setting
heroku addons:create heroku-postgresql:hobby-dev
//check
heroku config
→ Heroku web my page
DATABASE_URL
DB_HOST
DB_USER
DB_PASSWORD
DB_PORT
//extra setting if necessary
JWT_SECRET
CORS_ALLOW_ORIGIN //front end url
→ Working directory terminal
npm i pg pg-hstore
Add DB_PORT to config (due to postgres)
Change sequelize setting
import { config } from '../config.js';
import SQ from 'sequelize';
const { host, **port**, user, database, password } = config.db;
export const sequelize = new SQ.Sequelize(database, user, password, {
host,
**port**,
dialect: '**postgres**',
// ✨
logging: false,
**dialectOptions: {
ssl: {
require: true,
rejectUnauthorized: false,
}
}**
});
If you want to keep using start command as "nodemon app" in package.json...
make new file "Procfile" → web: node app.js
git commit → git push heroku sourceBranch:targetBranch
Client
Get your app url and put it in client's env file as your REACT_APP_BASE_URL
Terminal
npm build
netlify deploy
// Publish directory: build
netlify deploy --prod
frontend test!
Deploy React Apps in less than 30 Seconds | Netlify
npm run build
npm install netlify-cli -g
netlify deploy
// create & configure a new site
// ... publish directory: build