Created
March 27, 2025 18:52
-
-
Save Vatsalya-singhi/4a2ac25e0503a1b8f63666934a6db7dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// accessing env variables securely | |
import { Injectable } from '@nestjs/common'; | |
import { ConfigService } from '@nestjs/config'; | |
@Injectable() | |
export class AppService { | |
constructor(private configService: ConfigService) {} | |
getDatabaseUrl(): string { | |
return this.configService.get<string>('DATABASE_URL'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment