Sunday, February 16, 2020

It's all about Spring Boot


Building a Spring Boot application with Rest API

Building a Spring Boot and ReactJS mono-repo application

Spring Boot application with Postgresql on Heroku

  • On Mac, brew install Postgresql
  • Some useful commands to work with Postgresql on local:
    • By default, Postgresql is already started. If not, use this command to manually start the Postgresql
      pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    • To turn-off Postgresql manually, use this command pg_ctl -D /usr/local/var/postgres stop -s -m fast
    • To access Postgres from command prompt: psql postgres -U kad221
    • To stop the access to Postgres from command prompt: quit psql CMD+D
  • Follow the instructions to set up and push the spring boot application to Heroku: https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
  • In Heroku dashboard, select the spring boot application that is deployed.
  • Go to Resources, click on the Heroku Postgres, click on settings > View Credentials > Copy URI.
  • From command prompt: psql <paste the URI here> and hit enter.
  • In application.properties, add spring.datasource.url: <paste URI here>
  • From command prompt, run ./mvnw spring-boot:run, and you are good to go with the development.

No comments:

Post a Comment