Set "state.frontity.url" to separateed values for "development" and "production"

Description

Change settings for state.frontity.url to alllow values for both development and production. Something like

{
 frontity: {
   url : {
      "development" : "http://localhost:3000",
      "production" : "https://your-site.com",
    }
  }
}

Also, make “http://localhost:3000” the default value for state.frontity.url.development
state.frontity.url.production should be changed before deployment

These different values can be applied taking into account the proper Environment Variable

This change is suggested so the community gets better the purpose of these fields

I am not sure if we should implement this or not. Some questions that came to my mind:

  • What would be the benefit of using this setting instead of using environment variables?
  • What happens if I have different development environments like dev, staging or any custom ones like the ones we use with Pantheon Multidev?
  • If we do it in the frontity.url, should we do the same with the source.url?
  • Is this something other frameworks are doing? It feels a bit weird for me, but I am not a developer.
  • Maybe we should change the default frontity.url that right now is test.frontity.org and it could be confusing. Changing this to http://localhost:3000 (as it will be the common case for someone starting a Frontity project) would be clearer?

@dev-team Any feedback here?

If it depends on the environment, I would recommend using env variables. Sometimes people have 2 environments: production, and development. But sometimes people have also staging so that’s 3. Or multiple staging domains. Or individual deployments for each pull request…

@SantosGuillamot @luisherranz you’re both right.
Using env variables is the right approach here :+1:

1 Like