From 2d0e07b59f216ee82753e79812bd112a92798b2c Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Sun, 29 Mar 2020 21:29:00 -0500 Subject: [PATCH] Add initial support for multiple servers --- factorio-site.go | 5 +++-- templates/index.html | 16 ++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/factorio-site.go b/factorio-site.go index 1f8066b..d3ef01d 100644 --- a/factorio-site.go +++ b/factorio-site.go @@ -61,12 +61,13 @@ func main() { return } - data := serverData{ + data := []serverData{} + data = append(data, serverData{ *serverAddr, 34197, "Server with Bob's Mod, est. Feb 2020", playersOnline, - } + }) t.Execute(w, data) }) diff --git a/templates/index.html b/templates/index.html index bbd2f72..84401e3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -10,11 +10,15 @@ -

blackolivepineapple.pizza Factorio Server

- +

blackolivepineapple.pizza Factorio Servers

+ {{range .}} +

{{.Title}}

+ + {{end}}