16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/belphanior/servant/servant.rb', line 16
def servant_init
load_servant_config
servant_config.set_readonly "bind"
servant_config.set_readonly "port"
set :bind, servant_config.get("bind")
set :port, servant_config.get("port")
enable :lock
get '/' do
server_name = servant_config.get("server_name") || "<TODO: set name>"
<<EOF
<html>
<head>
<title>Belphanior Servant: #{server_name}</title>
</head>
<body>
<h1>Belphanior Servant Online</h1>
<h2>#{server_name}</h2>
<p>Hello! I am #{server_name}, and I am happy to serve you.</p>
<p>To learn more about what I can do, check my
<a href="/protocol">protocol</a>.</p>
<p>Want to know my settings? Check my <a href="/config">config</a>.
</body>
EOF
end
end
|