MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    After need take another config.js

    Troubleshooting
    2
    12
    587
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pi-user last edited by

      In which file is it defined that the config.js file is the main configuration file? Can you define different config.js files? How for example configXYZ.js? So take another config.js as needed?
      Many thanks for the help

      S 1 Reply Last reply Reply Quote 0
      • S
        sdetweil @pi-user last edited by

        @pi-user set env variable

        export config=???

        ??? Is new filename, full path if not in config folder

        Sam

        Create a working config
        How to add modules

        1 Reply Last reply Reply Quote 0
        • P
          pi-user last edited by

          @sdetweil said in After need take another config.js:

          export config

          Where can I put export config? So, that means that I can take another configuration file if necessary?

          S 1 Reply Last reply Reply Quote 0
          • S
            sdetweil @pi-user last edited by

            @pi-user in the terminal window or script. If pm2 then in installers/mm.sh

            Sam

            Create a working config
            How to add modules

            1 Reply Last reply Reply Quote 0
            • P
              pi-user last edited by

              @sdetweil said in After need take another config.js:

              mm.sh

              I discovered that the file name is defined in the check_config.js file!

              /opt/magic_mirror/tests/configs/check_config.js

              function getConfigFile() {
              // FIXME: This function should be in core. Do you want refactor me 😉 ?, be good!
              rootPath = path.resolve(__dirname + “/…/…/”);
              var configFileName = path.resolve(rootPath + “/config/config.js”);
              if (process.env.MM_CONFIG_FILE) {
              configFileName = path.resolve(process.env.MM_CONFIG_FILE);
              }
              return configFileName;
              }

              S 1 Reply Last reply Reply Quote 0
              • S
                sdetweil @pi-user last edited by

                @pi-user in electron.js is says process.env.config

                Sam

                Create a working config
                How to add modules

                P 2 Replies Last reply Reply Quote 0
                • P
                  pi-user @sdetweil last edited by

                  @sdetweil

                  Thank you

                  1 Reply Last reply Reply Quote 0
                  • P
                    pi-user @sdetweil last edited by

                    @sdetweil

                    I looked at it. But how can I edit this file so that another config file is read? Such as: configXYZ.js and not the standard name config.js

                    Thank you

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      sdetweil @pi-user last edited by

                      @pi-user just copy the default config.sample.js to anyname.js

                      then edit that name and do

                      export config=anyname.js
                      npm start

                      if using pm2, then edit the installers/mm.sh file which what pm2 starts
                      and add the export= line

                      Sam

                      Create a working config
                      How to add modules

                      P 1 Reply Last reply Reply Quote 0
                      • P
                        pi-user @sdetweil last edited by

                        @sdetweil

                        Thank you👍🏻

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • First post
                          Last post
                        Enjoying MagicMirror? Please consider a donation!
                        MagicMirror created by Michael Teeuw.
                        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                        This forum is using NodeBB as its core | Contributors
                        Contact | Privacy Policy