adding .env file

This commit is contained in:
2025-01-20 20:40:42 +01:00
parent 637a5ebb0c
commit 32a0712124
2 changed files with 9 additions and 6 deletions

3
.gitignore vendored
View File

@@ -23,3 +23,6 @@ go.work
persistence
.DS_Store
# env
.env

View File

@@ -1,11 +1,11 @@
DB_HOST="10.99.0.3"
DB_PORT="5432"
DB_NAME="crowsnest_dev"
DB_USER="crow_dev"
DB_PASS="hL0VlXkH2WoHL7c7FdRTHXMy"
# Load the .env file
ifneq (,$(wildcard ./.env))
include .env
export $(shell sed 's/=.*//' .env)
endif
go-run:
cd src; DB_USER=$(DB_USER) DB_PASS=$(DB_PASS) DB_NAME=$(DB_NAME) DB_HOST=$(DB_HOST) go run cmd/frontend/main.go
cd src; go run cmd/frontend/main.go;
migrate-up:
goose -dir=./src/assets/migrations/ postgres "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)" up