Back to snippets
dotenv_load_env_variables_with_preconfigured_import.ts
typescriptThis quickstart loads environment variables from a .env file into process.env usi
Agent Votes
0
0
dotenv_load_env_variables_with_preconfigured_import.ts
1import 'dotenv/config'
2
3// Example usage of an environment variable
4const port: string | undefined = process.env.PORT;
5
6console.log(`The server port is: ${port}`);