moonbridge
changeset 221:db8abd21762c
Code cleanup in helloworld.lua
author | jbe |
---|---|
date | Tue Jun 23 02:33:12 2015 +0200 (2015-06-23) |
parents | 6c02564342fe |
children | bae067af56d4 |
files | helloworld.lua |
line diff
1.1 --- a/helloworld.lua Tue Jun 23 02:11:41 2015 +0200 1.2 +++ b/helloworld.lua Tue Jun 23 02:33:12 2015 +0200 1.3 @@ -13,13 +13,19 @@ 1.4 local function error_response(status) 1.5 request:send_status(status) 1.6 request:send_header("Content-Type", "text/html") 1.7 - request:send_data("<html>\n<head><title>", status, "</title></head>\n<body><h1>", status, "</h1></body>\n</html>\n") 1.8 + request:send_data("<html>\n") 1.9 + request:send_data("<head><title>", status, "</title></head>\n") 1.10 + request:send_data("<body><h1>", status, "</h1></body>\n") 1.11 + request:send_data("</html>\n") 1.12 end 1.13 if request.method == "GET" or request.method == "HEAD" then 1.14 if request.path == "" then 1.15 request:send_status("200 OK") 1.16 request:send_header("Content-Type", "text/html; charset=UTF-8") 1.17 - request:send_data("<html>\n<head><title>Hello World Application</title></head>\n<body>Hello World!</body>\n</html>\n") 1.18 + request:send_data("<html>\n") 1.19 + request:send_data("<head><title>Hello World Application</title></head>\n") 1.20 + request:send_data("<body><h1>Hello World!</h1></body>\n") 1.21 + request:send_data("</html>\n") 1.22 else 1.23 error_response("404 Not Found") 1.24 end