Skip to content

Commit

Permalink
move inngest app declaration into Application.module
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin67 committed Feb 25, 2024
1 parent 08a99d1 commit 2f920d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion inngest-core/src/main/kotlin/com/inngest/routing/Ktor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.ktor.server.application.*
import io.ktor.server.response.*
import io.ktor.server.routing.*

fun Route.inngest(path: String) {
fun Route.inngestRoutes(path: String) {
route(path) {
get("") {
call.respondText("Get server status")
Expand Down
8 changes: 4 additions & 4 deletions inngest-test-server/src/main/kotlin/com/inngest/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.inngest.FunctionTrigger
import com.inngest.Inngest
import com.inngest.InngestEvent
import com.inngest.InngestFunction
import com.inngest.routing.inngest
import com.inngest.routing.inngestRoutes
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.engine.*
Expand All @@ -20,6 +20,8 @@ import java.time.Duration
data class IngestData(val message: String)

fun Application.module() {
var inngest = Inngest(app_id = "ktor-dev")

routing {
post("/api/inngest") {
val functionId = call.request.queryParameters["fnId"]
Expand Down Expand Up @@ -52,7 +54,7 @@ fun Application.module() {
call.respond(HttpStatusCode.OK, response)
}

inngest("/test")
inngestRoutes("/test")
}
}

Expand Down Expand Up @@ -122,8 +124,6 @@ val comm = CommHandler(functions = hashMapOf("fn-id-slug" to fn, "fn-follow-up"
fun main() {
var port = 8080

var inngest = Inngest(app_id = "ktor-dev")

println("Test server running on port " + port)

embeddedServer(
Expand Down

0 comments on commit 2f920d7

Please sign in to comment.