Rename "uri" endpoint configuration parameter to "path"

This commit is contained in:
2020-07-07 21:53:17 +02:00
parent 5f1e5b982d
commit b2f3f74237
5 changed files with 5 additions and 5 deletions

View File

@@ -71,7 +71,7 @@ class EndpointLoader(
consumer = parseConsumer(luaTable) consumer = parseConsumer(luaTable)
) )
private fun parseUri(luaTable: LuaTable) = luaTable.get("uri").checkjstring() private fun parseUri(luaTable: LuaTable) = luaTable.get("path").checkjstring()
.let { UriTemplate.parse(it) } .let { UriTemplate.parse(it) }
private fun parseConsumer(luaTable: LuaTable) = luaTable.get("consumer").checkclosure() private fun parseConsumer(luaTable: LuaTable) = luaTable.get("consumer").checkclosure()

View File

@@ -1,5 +1,5 @@
return { return {
uri = "/cache/{filename}.{ext}", path = "/cache/{filename}.{ext}",
method = Method.GET, method = Method.GET,
consumer = function(request) consumer = function(request)
local filename = string.format("%s.%s", request.path.filename, request.path.ext) local filename = string.format("%s.%s", request.path.filename, request.path.ext)

View File

@@ -1,5 +1,5 @@
return { return {
uri = "/tts.{ext}", path = "/tts.{ext}",
method = Method.GET, method = Method.GET,
consumer = function(request) consumer = function(request)
local format = (request.path.ext or "wav"):upper() local format = (request.path.ext or "wav"):upper()

View File

@@ -1,5 +1,5 @@
return { return {
uri = "/say", path = "/say",
method = Method.POST, method = Method.POST,
queued = true, queued = true,
accepts = Mime.JSON, accepts = Mime.JSON,

View File

@@ -30,7 +30,7 @@ function restoreSnapshotIfLast(queueLength)
end end
return { return {
uri = "/sonos", path = "/sonos",
method = Method.POST, method = Method.POST,
accepts = Mime.JSON, accepts = Mime.JSON,
queued = true, queued = true,