1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Quit command.

This commit is contained in:
Cedric Beust 2016-05-07 06:43:13 -07:00
parent 28d6f21c9e
commit 36c48b3000

View file

@ -29,6 +29,10 @@ class SparkServer(val initCallback: (String) -> List<Project>, val cleanUpCallba
override fun run(port: Int) { override fun run(port: Int) {
Spark.port(port) Spark.port(port)
Spark.get("/ping", { req, res -> "The Kobalt server is up and running" }) Spark.get("/ping", { req, res -> "The Kobalt server is up and running" })
Spark.get("/quit", {
req, res -> println("Kobalt server quitting...")
Spark.stop()
})
Spark.get("/v0/getDependencies", "application/json", Route { request, response -> Spark.get("/v0/getDependencies", "application/json", Route { request, response ->
val buildFile = request.queryParams("buildFile") val buildFile = request.queryParams("buildFile")
initCallback(buildFile) initCallback(buildFile)