diff options
| author | unwox <me@unwox.com> | 2024-09-27 15:33:26 +0600 |
|---|---|---|
| committer | unwox <me@unwox.com> | 2024-09-27 15:33:26 +0600 |
| commit | adae08e3dfca081da1a0bc70f3d242ea2b79efb3 (patch) | |
| tree | 6fe178c2892364140a0664423c8a3fafb354cbbe /main.go | |
| parent | 22dd9e85fcd899a4521ca2358e2310fc04998cbf (diff) | |
allow running one-shot scripts without serving HTTP
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -379,8 +379,11 @@ func main() { } }() - log.Printf("luna is running at %s...", *lAddr) - log.Fatal(http.ListenAndServe(*lAddr, mux)) + if len(routes) > 0 { + log.Printf("luna is running at %s...", *lAddr) + log.Fatal(http.ListenAndServe(*lAddr, mux)) + } + log.Printf("no HTTP-routes were registered, exiting...") } func printUsage() { |
