From 2475f5a8b92ef0dd28e7af5f36d01b25243ed778 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Thu, 6 Feb 2025 15:22:34 +0000 Subject: Initial commit --- api/handlers/index.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 api/handlers/index.go (limited to 'api/handlers/index.go') diff --git a/api/handlers/index.go b/api/handlers/index.go new file mode 100644 index 0000000..c165f3b --- /dev/null +++ b/api/handlers/index.go @@ -0,0 +1,22 @@ +package handlers + +import ( + "net/http" + + "github.com/LMBishop/gunnel/pkg/config" + "github.com/LMBishop/gunnel/web" +) + +func Index(configService config.Service) func(http.ResponseWriter, *http.Request) { + return func(w http.ResponseWriter, r *http.Request) { + web.Index().Execute(w, struct { + Host string + ExpireAfter int + Iface string + }{ + Host: configService.Config().Hostname, + ExpireAfter: configService.Config().ExpireAfter, + Iface: configService.Config().WireGuard.InterfaceName, + }) + } +} -- cgit v1.2.3-70-g09d2