On this page
Platform as a service (PaaS) is very popular solution to deploy web applications and websites. Luckily, GroupDocs.Comparison API can easily be integrated with them. In the article is described how you can deploy comparison example, that is written with Ktor Framework to one of the most popular PaaS platform - Heroku. The comparison example is free to use and is available on GitHub page.
To deploy the sample to Heroku server you need next applications to be installed
Heroku CLI- to get access to your account (of course, you need an account)
Git- to load the sample application and to deploy it to Heroku server
Click green button
Codeon the right top of the page and copy HTTPS repository link
Open Windows Command Line or Linux terminal and run next command
git clone https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java.git
Sample app was downloaded from GitHub to your local directory. Do not close the command line
- Special gradle task was added to
build.gradle.kts. It is needed for Heroku to build the executable file the sample
- Using port from
PORTenvironment variable (file
application.conf). It is important, because Heroku can change port each time app starts
Procfilewas created in order to say Heroku how to run out application
system.propertieswas created to specify Java version our app needs
In command line run next commands
It will open Heroku web page where you should log in to give command line tool access to your account
Create application running next command:
my-comparison-app-nameis the name of the app. You can use any name, but it must be unique. The result of the command will be a web url to access your new app and a link to heroku git repository:
https://my-comparison-app-name.herokuapp.com/ | https://git.heroku.com/my-comparison-app-name.git
Add heroku git repository link as a remote to sample app repository running next command:
my-comparison-app-nameis app name,
herokuis just a name which will be used by git to identify heroku git repository. You can change it, but don’t forget new one.
Push the application to Heroku server
Demos/Ktora path to the sample you want to push. The root of the path is a root directory of git project of the sample.
herokuis a name from previous step, that is used to identify heroku git repository.
masteris a git branch in Heroku git repository. Heroku deploys only
As a result of the command the sample will be uploaded to Heroku server and the build of the sample will be run. You will see the output of the build in command line. Everything must finish successfully. If so, just open link from step 2 (https://my-comparison-app-name.herokuapp.com/) in browser to see uploaded application. To check the app you can upload few files using Comparison UI.
You can manage your apps in Heroku web interface
To show common help use next commands
To show help for definite command, type it after
To show logs use next command (add
--tailparameter to show logs in real time)
To access remote filesystem you can use next command
Keep in mind, all changes in remote filesystem will be lost when the app restarts
To restart the app, use next commands
GroupDocs.Comparison API is a very powerful and modern solution for comparing different files, documents and images, while its samples are completely free and open to be modified. You can change them to work with Heroku add-ons, for example database or files storages. Ktor sample has different configurations (see
comparer.conf) which are available by setting environment variables. You can do it in Heroku web interface or from the command line.
Lots of comparison settings, for example, generating summary page, sensitivity of comparison and so on, are available only with license. You can get a free temporary license in order to use the API without evaluation limitations.
Ktor sample app for GroupDocs.Comparison is just one example of using GroupDocs.Comparison API for comparing Pdf, Word, Excel documents, PowerPoint presentations, Diagrams, CAD files, images and much more supported file formats. There are more samples of using GroupDocs.Comparison with Java and Kotlin on GitHub page. To get more details, options, and examples, you can go through the documentation and GitHub repository. Reach us on the forum for your queries.
- How to compare documents in the easiest way
- How to compare AutoCad files in Java or Kotlin
- How to compare files in Java or Kotlin
- How to compare images using Java or Kotlin
- How to deploy Spring comparison sample to Heroku PaaS platform
- How to use comparison tool with Ktor Framework
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.