diff --git a/com/Utils/Echo.lua b/com/Utils/Echo.lua new file mode 100644 index 0000000..77e438c --- /dev/null +++ b/com/Utils/Echo.lua @@ -0,0 +1,8 @@ +if not In.Params.msg or In.Params.msg == "" then + Out.Error = { + message = "there must be a msg parameter" + } + return +end + +Out.Result.answer = In.Params.msg \ No newline at end of file diff --git a/com/Utils/Ping.lua b/com/Utils/Ping.lua new file mode 100644 index 0000000..348ef2f --- /dev/null +++ b/com/Utils/Ping.lua @@ -0,0 +1 @@ +Out.Result.answer = "pong" \ No newline at end of file diff --git a/com/echo.lua b/com/echo.lua deleted file mode 100644 index 04603e6..0000000 --- a/com/echo.lua +++ /dev/null @@ -1,13 +0,0 @@ ---- #description = "Echoes back the message." ---- #args ---- msg = the message - -if not In.Params.msg or In.Params.msg == "" then - Out.Result.status = Status.error - Out.Result.error = "Missing parameter: msg" - return -end - -Out.Result.status = Status.ok -Out.Result.answer = In.Params.msg -return \ No newline at end of file