Skip to content

Commit

Permalink
dev startup message
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Sep 8, 2024
1 parent 51054f7 commit cb8f955
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ mise install
mise run setup

# Start the development server
# By default: https://localhost:3000
mise run
```

Expand Down
18 changes: 15 additions & 3 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ func main() {
},
}

serverLog.Info("starting server", "address", addr, "environment", cfg.Environment, "url", cfg.URL)
if cfg.Environment == "development" {
fmt.Println(startupLogo+"Open your browser and navigate to:", cfg.URL)
} else {
serverLog.Info("starting server", "address", addr, "environment", cfg.Environment, "url", cfg.URL)
}

if err := app.Listen(addr, listenConfig); err != nil {
return err
}
Expand All @@ -87,6 +92,13 @@ func main() {
log.Error("error", "error", err)
os.Exit(1)
}

log.Info("exiting")
}

var startupLogo = `
_______ __
/ ____(_) /_ ___ _____
/ /_ / / __ \/ _ \/ ___/
/ __/ / / /_/ / __/ /
/_/ /_/_.___/\___/_/
`

0 comments on commit cb8f955

Please sign in to comment.