mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-05-18 14:34:12 +02:00
feat(connector): add API endpoint for VDMJ
This commit is contained in:
parent
c3a2fbac13
commit
80be910456
@ -0,0 +1,23 @@
|
||||
package io.anthonyberg.connector.routes
|
||||
|
||||
import io.anthonyberg.connector.vdmj.vdmjExecute
|
||||
import io.ktor.http.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
|
||||
fun Route.vdmjRouting() {
|
||||
route("/vdmj") {
|
||||
get("{exp?}") {
|
||||
val exp = call.parameters["exp"] ?: return@get call.respondText(
|
||||
"Missing expression",
|
||||
status = HttpStatusCode.BadRequest,
|
||||
)
|
||||
|
||||
// TODO output is empty string after first request
|
||||
val result = vdmjExecute(exp)
|
||||
|
||||
call.respond(result)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user