Node.js
Fondamental
Handling environment variables with dotenv

Type d'évaluation

Mise en situation réelle

Analyse

Intelligence Artificielle

Compétences ciblées

nodejs
dotenv
environment
security
configuration

Scénario Technique

Context A Node.js application connects to a database using credentials currently hard-coded in the source code, creating a security risk. The Problem Database credentials and API keys are committed to the git repository in plain text. Current Code const db = connect("postgres://admin:secret123@localhost/mydb"); Constraints Use the dotenv package to load variables from a .env file. Access credentials via process.env. Add .env to .gitignore and provide a .env.example template. Expected Deliverable A Node.js application loading all sensitive configuration from environment variables using dotenv, with a .env.example file documenting required variables.

Prêt à évaluer ce talent ?

Accédez à l'interface de test complète pour soumettre votre architecture ou votre code.

Commencer le Défis
    Node.js - Handling environment variables with dotenv | Défi Technique & Recrutement — CodeDuel