mirror of
https://github.com/trafficlunar/api.git
synced 2026-06-27 22:24:08 +00:00
feat: add .env
This commit is contained in:
parent
f338d86663
commit
cb61a2a8b7
2 changed files with 10 additions and 0 deletions
|
|
@ -4,10 +4,18 @@ import (
|
|||
"log/slog"
|
||||
"os"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/lmittmann/tint"
|
||||
)
|
||||
|
||||
func main() {
|
||||
logger := slog.New(tint.NewHandler(os.Stderr, nil))
|
||||
slog.SetDefault(logger)
|
||||
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
slog.Error("Error loading .env file", slog.Any("error", err))
|
||||
}
|
||||
|
||||
slog.Info("Starting server", slog.Any("port", os.Getenv("PORT")))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue