Hermes Alves
Hermes Alves
DDeno
Created by Hermes Alves on 10/15/2024 in #help
Why isn't the API_PORT variable being loaded? Is there something I'm missing?
Thanks for your attentions guys
15 replies
DDeno
Created by Hermes Alves on 10/15/2024 in #help
Why isn't the API_PORT variable being loaded? Is there something I'm missing?
I'm new to Deno and I have a question regarding environment variables. For development, I need to specify the path to my .env file using dotenv to load the environment variables. However, when running in production (inside a Docker container), I assume I don't need to use dotenv since Docker can handle environment variables directly. Is my understanding correct? Do I need to manage .env files differently for development and production?
15 replies
DDeno
Created by Hermes Alves on 10/15/2024 in #help
Why isn't the API_PORT variable being loaded? Is there something I'm missing?
Yes, with a specify the envPath this work´s: const envVar = await load({envPath: "../.env", export: true})
15 replies
DDeno
Created by Hermes Alves on 10/15/2024 in #help
Why isn't the API_PORT variable being loaded? Is there something I'm missing?
No description
15 replies
DDeno
Created by Hermes Alves on 10/15/2024 in #help
Why isn't the API_PORT variable being loaded? Is there something I'm missing?
Didn´t work too.
# API
JWT_SECRET=$omeRand0mStr1ng
API_PORT=3737
# API
JWT_SECRET=$omeRand0mStr1ng
API_PORT=3737
15 replies
DDeno
Created by Hermes Alves on 10/15/2024 in #help
Why isn't the API_PORT variable being loaded? Is there something I'm missing?
The .env file is located in the root of the project, alongside the deno.json. The api folder contains the Hono-based API project. Here's the structure:
/.env
/deno.json
/api
├── app.ts
├── controllers
├── models
├── routes
├── services
/.env
/deno.json
/api
├── app.ts
├── controllers
├── models
├── routes
├── services
Any idea why the API_PORT isn't loading?
15 replies