Create POST /{format} endpoint (file.lua)
This commit is contained in:
@@ -2,8 +2,11 @@ return {
|
||||
uri = "/say",
|
||||
method = Method.POST,
|
||||
queued = true,
|
||||
accepts = "application/json",
|
||||
consumer = function()
|
||||
tts.say("Hello, world!", "en")
|
||||
accepts = Mime.JSON,
|
||||
consumer = function(request)
|
||||
if(config.silenceMode()) then return end
|
||||
|
||||
local body = json.decode(request.body)
|
||||
tts.say(body.text, body.language or "en")
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user