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() {
|
func init() {
|
||||||
|
log.Println("starting up")
|
||||||
|
|
||||||
templates = template.Must(template.New("").ParseGlob("static/*.html"))
|
templates = template.Must(template.New("").ParseGlob("static/*.html"))
|
||||||
template.Must(templates.ParseGlob("static/*.js"))
|
template.Must(templates.ParseGlob("static/*.js"))
|
||||||
|
|
||||||
|
pgconn := os.Getenv("PGCONN")
|
||||||
|
log.Println("connecting to database:", pgconn[:min(len(pgconn), 30)]+"...")
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
db, err = sql.Open("postgres", os.Getenv("PGCONN"))
|
db, err = sql.Open("postgres", pgconn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("[ERROR] failed to open database: ", err)
|
log.Fatal("[ERROR] failed to open database: ", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user