Skip to content
This repository was archived by the owner on Feb 12, 2025. It is now read-only.

Creating New Config Variables

Lean's edited this page Nov 10, 2023 · 3 revisions

To add a new config variable in the config-server.txt you can simple edit the load-config.js on the root page of the server`.

const archive, this is the txt that will be created if doesnt exist, in this giant string you can add your new variables see the example:

New Variable Example

...
"#This is the comment for your variable\n" +
"myCustomVariable=1000\n" +

You need to export now your variable into the code, to do that go to the final page where module.exports = function is located.

To add new variables to be called you can simple add this line after the let configs = await readFile(); and configs = createMap(configs);

Export Example for Strings

module.exports.myCustomVariable = configs.myCustomVariable;

Export Example for Integers

module.exports.myCustomVariable = configs.parseInt(myCustomVariable);

Now you can access this variables with the const { serverConfig } = require('....start-server')

Remember that new configs added you need to delete old config-server.txt for the server load the new configurations, or simple add the new configs in the file manually.

Clone this wiki locally