Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
Configuration file best practices node.js

I'm working on a node.js project where a lot of modules require a configuration file. At the moment I'm requiring the config file in each module, is it the best way of doing it? I've thought about setting the config as a global but it looks "dirty". Here's the file for now (do not mind the structure for now, it's still in development)

{
  "root" :  "undefined",
  "jwtAuthentication": {
    "appSecret": "XXXXXXXXXXXXX",
    "expiration": "48h"
  },
  "authorization": {
    "guestActions": [ "signup" ]
  }
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Here is how I set my project structure:

  module1
   --controllers
   --services
   --middleware
   --config
  module2
   --controllers
   --services
   --middleware
   --config
  shared
   --config
   --services

In shared/config I set global configuration and in module{i} configuration specific to that module.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda