Heroku is a cloud platform as a service that supports Kotlin. It has a free plan that will allow us to start working on integrating our clients with our API and is very easy to configure. I’m going to use a Github Action to make automatic deploys every time something is pushed to master. After you have created an account, we can follow with the next steps:
1. Create an authorization
In order to do this we need to create an API key to authorize Github to start the deploy.
2. Configure a deploy Github Action
I have found this action to work really well as it is very easy to configure. If your project is public, I recommend using Github Secrets to keep your private info out of the yml file.
3. Test your deployment is working
The GitHub Action above will deploy to Heroku once you push to master. There are two ways to follow the deploy progress:
- Checking the action progress on Github
- Checking the Heroku dashboard
At this point, you have REST API for your App with Spring Boot, Kotlin & Gradle. Your API is ready to start growing with your specific requirements, API calls and controller logic. The most important of all is that this setup enables a backend at zero cost and using latest technologies, which is perfect as an initial starting point for your pet projects.
This article is part of a series of tutorials:
- Part 1. First Controller
- Part 2. Securing with OAuth2
- Part 3. Adding a H2 database
- Part 4. Testing the API
- Part 5. Deploy on Heroku
The entire code is available on Github:
cvillaseca/mobileAPIREST API with Oauth2 using Springboot 2.2.X written in Kotlin - cvillaseca/mobileAPI |
![]() |
Remember to follow, share & hit the 👏 button if you liked it! :)
Thanks to Mario Sanoguera de Lorenzo.