summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9dd37fb)
raw | patch | inline | side by side (parent: 9dd37fb)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 22 Feb 2015 18:25:26 +0000 (19:25 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 22 Feb 2015 18:25:26 +0000 (19:25 +0100) |
server/server.go | patch | blob | history |
diff --git a/server/server.go b/server/server.go
index 2b0c27e9ce0dc9882c00e2d336516f9c4dfe2f48..093c683bb598eabc77e5e8ba76f80955cb39b459 100644 (file)
--- a/server/server.go
+++ b/server/server.go
}
func index(_ request, s *Server) (*page, error) {
- return &page{Content: "<section><h1>Welcome to the System Database.</h1></section>"}, nil
+ c := <-s.conns
+ defer func() { s.conns <- c }()
+
+ major, minor, patch, extra, err := c.ServerVersion()
+ if err != nil {
+ return nil, err
+ }
+
+ content := fmt.Sprintf("<section>"+
+ "<h1>Welcome to the System Database.</h1>"+
+ "<p>Connected to SysDB %d.%d.%d%s</p>"+
+ "</section>", major, minor, patch, html(extra))
+ return &page{Content: template.HTML(content)}, nil
}
func tmpl(t *template.Template, data interface{}) (*page, error) {