Преглед на файлове

Add test with new Lua syntax

bel2125 преди 4 години
родител
ревизия
08520c1bc7
променени са 1 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 10 0
      test/page7.lua

+ 10 - 0
test/page7.lua

@@ -0,0 +1,10 @@
+-- reflect the request information as JSON
+json = require "json"
+
+response = json.encode(mg.request_info)
+
+mg.response.status = 200
+mg.response.http_headers["Content-Type"] = "application/json; charset=utf-8";
+mg.response.http_headers["Content-Length"] = #response;
+mg.response.send()
+mg.write(response)