feat: migrate backend to Golang (Gin + GORM)

This commit is contained in:
2026-10-30 01:55:46 +03:00
parent 65003b6119
commit 94907ee68d
20 changed files with 952 additions and 117 deletions
+27
View File
@@ -0,0 +1,27 @@
package config
import "os"
type Config struct {
Port string
DatabaseURL string
SessionTTLSeconds int
}
func Load() *Config {
port := os.Getenv("APP_PORT")
if port == "" {
port = "8080"
}
dbURL := os.Getenv("DATABASE_URL")
if dbURL == "" {
dbURL = "postgresql://postgres:postgres@postgres:5432/messenger"
}
return &Config{
Port: port,
DatabaseURL: dbURL,
SessionTTLSeconds: 3600,
}
}