Search code examples
javascriptmodel-view-controllerglobal-variablesgeddy

How do I create a global variable in Geddy


I'm like to define a global variable box that is available in all controllers across my app in Geddy. How would one go about doing this?


Solution

  • You can add a global variable in: /config/secrets.json. If you don't have this secret yet it can be generate using:

    geddy gen secret
    

    And then add below to the secret.json.

    {
        "box": "value of box"
    }
    

    And value can be used geddy.config.box