fix(backend): update default port to 8214 and fix env loading

This commit is contained in:
Tiago Yamamoto 2025-12-18 10:39:42 -03:00
parent 4037ab6876
commit 521c7f1377
2 changed files with 4 additions and 2 deletions

View file

@ -24,7 +24,7 @@ type Config struct {
func Load() Config { func Load() Config {
cfg := Config{ cfg := Config{
AppName: getEnv("APP_NAME", "saveinmed-performance-core"), AppName: getEnv("APP_NAME", "saveinmed-performance-core"),
Port: getEnv("PORT", "8080"), Port: getEnv("PORT", "8214"),
DatabaseURL: getEnv("DATABASE_URL", "postgres://postgres:postgres@localhost:5432/saveinmed?sslmode=disable"), DatabaseURL: getEnv("DATABASE_URL", "postgres://postgres:postgres@localhost:5432/saveinmed?sslmode=disable"),
MaxOpenConns: getEnvInt("DB_MAX_OPEN_CONNS", 15), MaxOpenConns: getEnvInt("DB_MAX_OPEN_CONNS", 15),
MaxIdleConns: getEnvInt("DB_MAX_IDLE_CONNS", 5), MaxIdleConns: getEnvInt("DB_MAX_IDLE_CONNS", 5),

View file

@ -127,7 +127,9 @@ start_backend() {
# Carregar variáveis de ambiente se existir .env # Carregar variáveis de ambiente se existir .env
if [ -f ".env" ]; then if [ -f ".env" ]; then
echo -e "${GREEN} ✓ Carregando variáveis de .env${NC}" echo -e "${GREEN} ✓ Carregando variáveis de .env${NC}"
export $(grep -v '^#' .env | xargs) set -a
source .env
set +a
else else
echo -e "${YELLOW} ⚠ Arquivo .env não encontrado, usando valores padrão${NC}" echo -e "${YELLOW} ⚠ Arquivo .env não encontrado, usando valores padrão${NC}"
fi fi