From ad75d2c7740528aabc87cf443fef1d1737a4c0bd Mon Sep 17 00:00:00 2001 From: Alexandre Iooss Date: Mon, 21 Sep 2020 21:05:45 +0200 Subject: [PATCH] Put web server in a goroutine --- main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f4e582b..e15dd39 100644 --- a/main.go +++ b/main.go @@ -14,6 +14,11 @@ func main() { log.Fatal(err) } - // Start web server - web.ServeHTTP(cfg) + // Start web server routine + go func() { + web.ServeHTTP(cfg) + }() + + // Wait for routines + select {} }