How do php and node.js share a configuration file?

  node.js, question

I wrote a website and he used it.phpAndnode.js, they respectively have their own config files (config.php and config.js) to set the account password of the database or something. Each time they put it on the cloud server, they have to modify the two config files. In fact, the two config files are similar in content. Can they be written together? Make it easier to modify later?

With a config.json as the shared configuration, config.php and config.js can directly read the configuration file in JSON and output the original variables. However, since it is a static file, remember that config.json has set HTTP permissions, and don’t let others drag the configuration.