- servlet1 (
HelloServlet.Get
message) - servlet2a (no params, all students from the Db)
- servlet2b (param
x=1
given, userById run)
- servlet1 (
HelloServlet.Get
message) - servlet2a (no params, all students from the Db)
- servlet2b (param
x=1
given, userById run)
- install heroku cli link
- create and upload ssh keys link
- check whether everything is ok (locally):
mvn clean install && heroku local web
- to login to heroku server, run in the command line
heroku login
(browser will be opened for further authorization) - to create a new app on heroku server, run in the command line
heroku create
, output should look like this:
Creating app... done, ⬢ young-garden-08016
https://young-garden-08016.herokuapp.com/ | https://git.heroku.com/young-garden-08016.git
- look for the git remotes:
git remote -v
, output should look like this:
heroku https://git.heroku.com/young-garden-08016.git (fetch)
heroku https://git.heroku.com/young-garden-08016.git (push)
origin https://github.com/alexr007/java-heroku-from-zero-to-hero.git (fetch)
origin https://github.com/alexr007/java-heroku-from-zero-to-hero.git (push)
- push your code to heroku
git push heroku master
- go to heroku dashboard
- click
young-garden-08016
(your app name) - click
Resources
- in the add-ons type:
Postgres
- click
Heroku Postgres
- click
Provision
- click
Heroku Postgres
in the list below - go to
Settings
, look forCredentials
(you can use them in your DataGrip)
heroku ps
heroku open
heroku ps:scale web=1
heroku logs --tail
Procfile
contents:- fully-qualified path to the
main class
classpath
declaration
- fully-qualified path to the
pom.xml
sections:<packaging>jar
<pluginns>maven-dependency-plugin...
DATABASE_URL
looks likepostgres:...
JDBC_DATABASE_URL
looks likejdbc:postgresql:...
PORT
http port to listen