Skip to content

Commit

Permalink
Configure Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Apr 26, 2024
1 parent 570467a commit 0ffdc3a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: ./server/build/install/server/bin/server
4 changes: 4 additions & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ application {
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=${extra["development"] ?: "false"}")
}

tasks {
create("stage").dependsOn("installDist")
}

dependencies {
implementation(projects.shared)
implementation(libs.logback)
Expand Down
9 changes: 6 additions & 3 deletions server/src/main/kotlin/ivy/learn/Application.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package ivy.learn

import SERVER_PORT
import io.ktor.server.application.*
import io.ktor.server.engine.*
import io.ktor.server.netty.*
import io.ktor.server.response.*
import io.ktor.server.routing.*

fun main() {
embeddedServer(Netty, port = SERVER_PORT, host = "0.0.0.0", module = Application::module)
.start(wait = true)
embeddedServer(
Netty,
port = System.getenv("PORT")?.toInt() ?: 8080,
host = "0.0.0.0",
module = Application::module
).start(wait = true)
}

fun Application.module() {
Expand Down
1 change: 0 additions & 1 deletion shared/src/commonMain/kotlin/Constants.kt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
const val SERVER_PORT = 8084

0 comments on commit 0ffdc3a

Please sign in to comment.