Jelajahi Sumber

Add test with new Lua syntax

bel2125 4 tahun lalu
induk
melakukan
08520c1bc7
1 mengubah file dengan 10 tambahan dan 0 penghapusan
  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)