Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

262
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!