diff --git a/inngest-core/src/main/kotlin/com/inngest/routing/Ktor.kt b/inngest-core/src/main/kotlin/com/inngest/routing/Ktor.kt index 42a9c2bd..ce2c12de 100644 --- a/inngest-core/src/main/kotlin/com/inngest/routing/Ktor.kt +++ b/inngest-core/src/main/kotlin/com/inngest/routing/Ktor.kt @@ -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") diff --git a/inngest-test-server/src/main/kotlin/com/inngest/App.kt b/inngest-test-server/src/main/kotlin/com/inngest/App.kt index 1f2d36c5..90d8481e 100644 --- a/inngest-test-server/src/main/kotlin/com/inngest/App.kt +++ b/inngest-test-server/src/main/kotlin/com/inngest/App.kt @@ -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.* @@ -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"] @@ -52,7 +54,7 @@ fun Application.module() { call.respond(HttpStatusCode.OK, response) } - inngest("/test") + inngestRoutes("/test") } } @@ -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(