feat(connector): change VDMJ to use interpreter

This commit is contained in:
Anthony Berg
2024-04-18 17:16:48 +01:00
parent b784ab9799
commit e781c12d22
3 changed files with 88 additions and 47 deletions

View File

@@ -1,12 +1,14 @@
package io.anthonyberg.connector.routes
import io.anthonyberg.connector.shared.vdmj.vdmjExecute
import io.anthonyberg.connector.shared.vdmj.VDMJ
import io.ktor.http.*
import io.ktor.server.application.*
import io.ktor.server.response.*
import io.ktor.server.routing.*
fun Route.vdmjRouting() {
val vdmj = VDMJ()
route("/vdmj") {
get("{exp?}") {
val exp = call.parameters["exp"] ?: return@get call.respondText(
@@ -15,7 +17,7 @@ fun Route.vdmjRouting() {
)
// TODO output is empty string after first request
val result = vdmjExecute(exp)
val result = vdmj.run(exp)
call.respond(result)
}