nitcorn :: StaticAction :: defaultinit
# An action that responds by displaying a static html content.
class StaticAction
super Action
redef fun answer(http_request, turi)
do
var response = new HttpResponse(200)
var title = "Hello World from Nitcorn!"
response.body = """
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<title>{{{title}}}</title>
</head>
<body>
<div class="container">
<h1>{{{title}}}</h1>
<p>See also a <a href="/dir/">directory</a>.</p>
</div>
</body>
</html>"""
return response
end
end
lib/nitcorn/examples/src/nitcorn_hello_world.nit:26,1--51,3