Compare commits
2 Commits
7d6a521f12
...
7fd104b6d0
Author | SHA1 | Date | |
---|---|---|---|
7fd104b6d0
|
|||
abddaaf51a
|
12
.env.example
Normal file
12
.env.example
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
DATABASE_URL="postgres://<user>:<user>@<host>:<port>/<db>?sslmode=disable"
|
||||
|
||||
ADMIN_NAME="admin"
|
||||
ADMIN_EMAIL="admin@test.net"
|
||||
ADMIN_PASSWORD="secret"
|
||||
|
||||
GOOSE_DRIVER="postgres"
|
||||
GOOSE_DBSTRING=$DATABASE_URL
|
||||
GOOSE_MIGRATION_DIR="./migrations"
|
||||
|
||||
|
@ -9,9 +9,16 @@ import (
|
||||
"gitea.local/admin/hspguard/internal/repository"
|
||||
"gitea.local/admin/hspguard/internal/user"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/joho/godotenv"
|
||||
)
|
||||
|
||||
func main() {
|
||||
err := godotenv.Load()
|
||||
if err != nil {
|
||||
log.Fatalln("ERR: Failed to load environment variables:", err)
|
||||
return
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
conn, err := pgx.Connect(ctx, os.Getenv("DATABASE_URL"))
|
||||
|
Reference in New Issue
Block a user