Azure-Samples / contoso-real-estate

Intelligent enterprise-grade reference architecture for JavaScript, featuring OpenAI integration, Azure Developer CLI template and Playwright tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Chore] API can't use Azure PG locally due to .env issue

dfberry opened this issue · comments

Are you accessing the project from the GitHub Codespaces?

  • No, I am running the project on my local machine (I will fill in the OS section below)
  • [x ] Yes, I am using GitHub Codespaces.

Note: The project is optimized to run on Codespaces. We welcome contributions to enhance it for cross-platform local development, but it's not something we will prioritize right now. Thank you!

Describe the bug
The API package incorrectly uses the local .env file.

To Reproduce
Steps to reproduce the behavior:

  1. Provision resources: azd provision
  2. Create local env file from /packages/api: npm run env which creates a .env file
  3. From root, start API: npm run start:api
  4. Try to get listings: https://CodespacesURL/api/listings
  5. Get error about getting refused from postgres (local db)

Expected behavior
Local development successfully connects to Azure Postgres

OS (please complete the following information):

  • OS:
  • OS Version:
  • npm version:
  • Node.js version:
  • output of azd version:

Additional context
Add any other context about the problem here.

We are currently only supporting local development env variables. Would you like to work (or have you worked) on adding support ?

Closed due to inactivity.