Skip to content

Commit d44a9cd

Browse files
committed
Update gradle wrapper to 5.4.1
Update startup messaging Add shadow jar to build fat jar with deps for release Add configurable startup port
1 parent 2d0c82f commit d44a9cd

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

build.gradle.kts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ val http4kVersion = "3.140.0"
55

66
plugins {
77
kotlin("jvm") version "1.3.31"
8+
id("com.github.johnrengelman.shadow") version "5.0.0"
89
}
910

1011
group = "com.batchofcode"
11-
version = "1.0-SNAPSHOT"
12+
version = "0.1-SNAPSHOT"
13+
val artifactId = "aws-lambda-runtime-local"
1214

1315
repositories {
1416
mavenCentral()
@@ -28,4 +30,10 @@ dependencies {
2830

2931
tasks.withType<KotlinCompile> {
3032
kotlinOptions.jvmTarget = "11"
33+
}
34+
35+
val jar by tasks.getting(Jar::class) {
36+
manifest {
37+
attributes["Main-Class"] = "com.batchofcode.runtimelocal.handler.RootHandlerKt"
38+
}
3139
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.batchofcode.runtimelocal.config
2+
3+
object EnvConfig {
4+
val port = System.getProperty("port")?.toInt() ?: 9000
5+
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
package com.batchofcode.runtimelocal.handler
22

3+
import com.batchofcode.runtimelocal.config.EnvConfig
34
import org.http4k.core.then
45
import org.http4k.filter.ServerFilters
56
import org.http4k.server.ApacheServer
67
import org.http4k.server.asServer
78

89
fun main() {
9-
val port = 9000
10+
val port = EnvConfig.port
1011

1112
ServerFilters.CatchAll()
1213
.then(Routes())
1314
.asServer(ApacheServer(port)).start()
1415

1516
println("Started Lambda Runtime Local on Port $port")
17+
println("Available Lambda Runtime Endpoints ------------------------------------------------")
1618
println("GET invocations - http://localhost:$port/2018-06-01/runtime/invocation/next")
17-
println("POST events - http://localhost:$port/2018-06-01/runtime/events/next")
19+
println("POST invocation error - http://localhost:$port/2018-06-01/runtime/invocation/error")
1820
println("POST init error - http://localhost:$port/2018-06-01/runtime/init/error")
21+
println("-----------------------------------------------------------------------------------")
22+
println("Helper Endpoints:")
23+
println("POST events - http://localhost:$port/events/next")
1924
}

0 commit comments

Comments
 (0)