Thanks to visit codestin.com
Credit goes to github.com

Skip to content

larmic/ktor-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ktor-demo

Java CI with Maven License

Simple ktor jackson example.

Used technologies

  • Ktor 1.5.0
  • Kotlin 1.4.21-2
  • JUnit 5.7.0
  • assertk 0.23
  • Docker
  • GitHub Actions (CI)

Requirements

  • Java 11
  • Maven >= 3.2.1 (Kotlin comes as maven dependency)

Clone repository and build project with tests

$ git clone https://github.com/larmic/ktor-demo
$ mvn clean verify

Fat-Jar

# build application
$ mvn clean package -DskipTests

# start application
$ java -jar target/ktor-*-with-dependencies.jar 

Docker in JVM mode

# build application
$ mvn clean package -DskipTests

# build docker image
$ docker build -t larmic/ktor-demo-jvm -f src/main/docker/Dockerfile.jvm .

# start application
$ docker run -i --rm -p 8080:8080 larmic/ktor-demo-jvm

Local testing

# HTTP request examples
# Get root
$ curl --request GET http://localhost:8080/

# Get all tasks
$ curl -i -H "Content-Type: application/json" --request GET http://localhost:8080/tasks

# Get one task   
$ curl -i -H "Content-Type: application/json" --request GET http://localhost:8080/tasks/1      

About

Simple ktor demo using maven

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages