File tree Expand file tree Collapse file tree 4 files changed +22
-4
lines changed
src/main/kotlin/com/batchofcode/runtimelocal Expand file tree Collapse file tree 4 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,12 @@ val http4kVersion = "3.140.0"
5
5
6
6
plugins {
7
7
kotlin(" jvm" ) version " 1.3.31"
8
+ id(" com.github.johnrengelman.shadow" ) version " 5.0.0"
8
9
}
9
10
10
11
group = " com.batchofcode"
11
- version = " 1.0-SNAPSHOT"
12
+ version = " 0.1-SNAPSHOT"
13
+ val artifactId = " aws-lambda-runtime-local"
12
14
13
15
repositories {
14
16
mavenCentral()
@@ -28,4 +30,10 @@ dependencies {
28
30
29
31
tasks.withType<KotlinCompile > {
30
32
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
+ }
31
39
}
Original file line number Diff line number Diff line change 1
1
distributionBase =GRADLE_USER_HOME
2
2
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
4
4
zipStoreBase =GRADLE_USER_HOME
5
5
zipStorePath =wrapper/dists
Original file line number Diff line number Diff line change
1
+ package com.batchofcode.runtimelocal.config
2
+
3
+ object EnvConfig {
4
+ val port = System .getProperty(" port" )?.toInt() ? : 9000
5
+ }
Original file line number Diff line number Diff line change 1
1
package com.batchofcode.runtimelocal.handler
2
2
3
+ import com.batchofcode.runtimelocal.config.EnvConfig
3
4
import org.http4k.core.then
4
5
import org.http4k.filter.ServerFilters
5
6
import org.http4k.server.ApacheServer
6
7
import org.http4k.server.asServer
7
8
8
9
fun main () {
9
- val port = 9000
10
+ val port = EnvConfig .port
10
11
11
12
ServerFilters .CatchAll ()
12
13
.then(Routes ())
13
14
.asServer(ApacheServer (port)).start()
14
15
15
16
println (" Started Lambda Runtime Local on Port $port " )
17
+ println (" Available Lambda Runtime Endpoints ------------------------------------------------" )
16
18
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 " )
18
20
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" )
19
24
}
You can’t perform that action at this time.
0 commit comments