This project is for testing development with docker, kotlin, gradle, ktor and postgreSQL
- JDK 21
- Kotlin
- Gradle
- Docker
- Ktor
- Postgres
- Editorconfig
Make sure you have the Java JDK 21 installed You can check which version you have installed using this command:
java -version
Make sure you have the Docker installed You can check which version you have installed using this command:
docker --version
Make sure you have the Docker-compose installed You can check which version you have installed using this command:
docker-compose --version
To build locally and run the integration tests you can simply run
./gradlew shadowJar
or on windows gradlew.bat shadowJar
Creating a docker image should be as simple as
docker build -t docker-kotlin-gradle-ktor-postgres .
docker run -d --rm -it -p 8080:8080 -e "DATABASE_HOST_URL=db" docker-kotlin-gradle-ktor-postgres
docker-compose -p docker-kotlin-gradle-ktor-postgres-compose up -d
docker-compose -p docker-kotlin-gradle-ktor-postgres-compose down
Go to src/main/kotlin/Application.kt and run the main method
For testing the endpoint ValidateDataApi
You need a tool to send a request and to inspect the repsonse
A tool you can use is Postman: https://www.postman.com/downloads/
The endpoint is currently available at http://0.0.0.0/v1/validate when running the application locally
Set the body in the request, example: {"data":"DATA"}
and profit
Example of a request:
`curl --location --request POST 'http://0.0.0.0:8080/v1/validate' \
--header 'Content-Type: application/json' \
--data-raw '{"data":"DATA"}'`
Example of a response:
{"result":"OK"}
Find the newest version of gradle here: https://gradle.org/releases/ Then run this command: (Remeber to repealce $gradleVersjon with newest version)
./gradlew wrapper --gradle-version $gradleVersjon
Want to add a feature? see CONTRIBUTING
This project is maintained by CODEOWNERS
Questions please create an issue