Production
Our API is ready to be deployed, this time for production!
First, update the gradle.build
file as follows:
jar {
manifest {
- attributes 'Main-Class' : 'ApiServer'
+ attributes 'Main-Class' : 'api.Server'
}
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
Then, open the Gradle Tool Window and refresh the project. Next, click on "clean", "build", "jar", and "deployHeroku", in that order. Each time your click on one of these tasks, you must wait for the task to finish before clicking on (running) the next one!
If all goes well, your API is deployed on Heroku. To ensure everything works as expected, open Postman and edit the BASE_URL
variable for the course-search-api
collection; set it to the URL of your Heroku app (mine is https://course-search-api-421.herokuapp.com
). Run all the requests in this Postman collection; they must all work as expected.