NRuby
26 строк · 439.0 Байт
1require 'rack'
2
3class App
4class << self
5def call(env)
6[200, { 'Content-Type' => 'text/html' }, [template('Hello, Ruby!')]]
7end
8
9def template(name)
10<<~HTML
11<!DOCTYPE html>
12<html lang="ru">
13<head>
14<title>#{name}</title>
15<meta charset='utf-8'>
16</head>
17<body>
18<h1>#{name}</h1>
19</body>
20</html>
21HTML
22end
23end
24end
25
26run App
27