Add startup logging for debugging
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
7
main.go
7
main.go
@@ -28,11 +28,16 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
log.Println("starting up")
|
||||
|
||||
templates = template.Must(template.New("").ParseGlob("static/*.html"))
|
||||
template.Must(templates.ParseGlob("static/*.js"))
|
||||
|
||||
pgconn := os.Getenv("PGCONN")
|
||||
log.Println("connecting to database:", pgconn[:min(len(pgconn), 30)]+"...")
|
||||
|
||||
var err error
|
||||
db, err = sql.Open("postgres", os.Getenv("PGCONN"))
|
||||
db, err = sql.Open("postgres", pgconn)
|
||||
if err != nil {
|
||||
log.Fatal("[ERROR] failed to open database: ", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user