The Ktor Gradle plugin allows to create and run an executable JAR that includes all code dependencies (fat JAR).
- Building the fat JAR: Employ the
buildFatJar
Gradle task provided by Ktor.
- To run the fat JAR locally, either execute the
runFatJar
Gradle task or use the command line. For the latter, open a terminal and navigate to the rootbuild/libs
directory, where the fat JAR is located. Execute the following command:
java.exe -jar krud-1.0.0-all.jar
Upon server startup, observe the console output. Once initialization is complete, you can test the server by opening a web browser and navigating to any of the following URLs: