create docker for the API
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
package eventDemo
|
||||
|
||||
import eventDemo.configuration.configure
|
||||
import io.ktor.server.application.Application
|
||||
import io.ktor.server.engine.embeddedServer
|
||||
import io.ktor.server.netty.Netty
|
||||
import io.ktor.server.netty.EngineMain
|
||||
|
||||
fun main() {
|
||||
embeddedServer(
|
||||
factory = Netty,
|
||||
port = 8080,
|
||||
host = "0.0.0.0",
|
||||
module = Application::configure,
|
||||
watchPaths = listOf("classes"),
|
||||
).start(wait = true)
|
||||
}
|
||||
fun main(args: Array<String>): Unit =
|
||||
EngineMain.main(args)
|
||||
|
||||
@@ -5,12 +5,12 @@ import io.ktor.server.application.install
|
||||
import io.ktor.server.websocket.WebSockets
|
||||
import io.ktor.server.websocket.pingPeriod
|
||||
import io.ktor.server.websocket.timeout
|
||||
import java.time.Duration
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
fun Application.configureWebSockets() {
|
||||
install(WebSockets) {
|
||||
pingPeriod = Duration.ofSeconds(15)
|
||||
timeout = Duration.ofSeconds(15)
|
||||
pingPeriod = 15.seconds
|
||||
timeout = 15.seconds
|
||||
maxFrameSize = Long.MAX_VALUE
|
||||
masking = false
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.koin.ktor.ext.get
|
||||
|
||||
fun Application.declareHttpGameRoute() {
|
||||
routing {
|
||||
readTheGameState(get())
|
||||
readGamesList(get())
|
||||
readTheGameState(this@declareHttpGameRoute.get())
|
||||
readGamesList(this@declareHttpGameRoute.get())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
ktor {
|
||||
deployment {
|
||||
port = 8080
|
||||
host = 0.0.0.0
|
||||
}
|
||||
application {
|
||||
modules = [ eventDemo.configuration.ConfigureKt.configure ]
|
||||
}
|
||||
}
|
||||
|
||||
jwt {
|
||||
secret = "secret"
|
||||
secret = ${?JWT_SECRET}
|
||||
|
||||
Reference in New Issue
Block a user