Giter VIP home page Giter VIP logo

yt-heroku-demo's Introduction

1. Download Heroku CLI: https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
2. Commands:
>>	heroku login
>>	git init
>>	git add .
>>	git commit -m "First Commit"
>>	heroku create <app-name>
>>	git push heroku master
>>	heroku open

------> Now the website should work if you do not have any databases in it
------> To Enably MySQL Database: (This adds Postgres database addon)
>>	heroku addons:create heroku-postgresql

Add this dependency in maven pom file (used for Postgres database addon that will enable our database to work):

<dependency>
	<groupId>org.postgresql</groupId>
	<artifactId>postgresql</artifactId>
	<version>9.4-1201-jdbc4</version>
</dependency>

------------------------------------------------------------------------------
Then edit the connection attributes in application.properties file to contain:

spring.datasource.url=${JDBC_DATABASE_URL}
spring.datasource.username=${JDBC_DATABASE_USERNAME}
spring.datasource.password=${JDBC_DATABASE_PASSWORD}
spring.jpa.show-sql=false
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=create

*** Important note: 
It's important that at first time you leave this last line and set it "create" so that your database gets created. 
After that change it to "update" and commit and push once more. (i.e. git add . && git commit -m "application.properties edited" && git push heroku master)

______________________________________________________________________
This tutorial is based on the following two articles (and other):
https://devcenter.heroku.com/articles/deploying-spring-boot-apps-to-heroku
https://devcenter.heroku.com/articles/connecting-to-relational-databases-on-heroku-with-java

yt-heroku-demo's People

Contributors

abdallah-abdelazim avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.