re-write with std usage of net/http

This commit is contained in:
Sebastian Cabrera 2025-06-11 15:49:47 -04:00
parent c107d94b11
commit 81bc046237
Signed by: okseby
GPG key ID: DA858232740D0404
10 changed files with 419 additions and 97 deletions

28
internal/config/config.go Normal file
View file

@ -0,0 +1,28 @@
package config
import (
"os"
)
type Config struct {
Port string
StaticDir string
Environment string
}
var AppConfig Config
func Load() {
AppConfig = Config{
Port: getEnv("PORT", "7878"),
StaticDir: getEnv("STATIC_DIR", "static"),
Environment: getEnv("ENVIRONMENT", "development"),
}
}
func getEnv(key, fallback string) string {
if value, ok := os.LookupEnv(key); ok {
return value
}
return fallback
}