Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rowi1de authored Nov 23, 2024
1 parent 65bbe57 commit bc765f4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ See [Help.md](HELP.md) for framework hints
## Run and use
```shell
./gradlew bootBuildImage
docker-compose up -d
docker-compose --profile native up -d
http http://localhost:8080/hello
```
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ kotlin {
}
}

graalvmNative {
metadataRepository {
version = "0.3.14"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
2 changes: 2 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
MYSQL_DATABASE: admin
netty-native:
image: docker.io/library/netty-native:0.0.1-SNAPSHOT
profiles:
- native
ports:
- 8080:8080
healthcheck:
Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/netty/graalvm/HelloController.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package netty.graalvm

import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import reactor.core.publisher.Mono

@RestController
@RequestMapping("hello")
class HelloController {

@GetMapping("/")
@GetMapping("/hello")
fun hello(): Mono<String> = Mono.just("Hello, Netty!")
}
2 changes: 2 additions & 0 deletions src/main/kotlin/netty/graalvm/NettyNativeApiApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ package netty.graalvm
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.boot.runApplication
import org.springframework.web.reactive.config.EnableWebFlux

@SpringBootApplication
@EnableConfigurationProperties
@EnableWebFlux
class NettyNativeApiApplication

fun main(args: Array<String>) {
Expand Down

0 comments on commit bc765f4

Please sign in to comment.