Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

263
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda