소스 검색

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)