feedhenry / fh-db

Apache License 2.0
1 stars 16 forks source link

Allow developers to use different port locally #16

Closed alanmoran closed 7 years ago

alanmoran commented 7 years ago

Motivation

We force developers to have mongo running on 27017. Some folks out there like running these things off custom ports 👎 Small PR to introduce yet another environment variable that allows the developer to overwrite this.

This will allow developers to update the Gruntfile we provide in the cloud app template to specify a custom port like so:

env: {
      options: {},
      // environment variables - see https://github.com/jsoverson/grunt-env for more information
      local: {
        FH_USE_LOCAL_DB: true,
        FH_LOCAL_DB_PORT: '122331',
        FH_SERVICE_MAP: function() {
          /*
           * Define the mappings for your services here - for local development.
           * You must provide a mapping for each service you wish to access
           * This can be a mapping to a locally running instance of the service (for local development)
           * or a remote instance.
           */
          var serviceMap = {
            'SERVICE_GUID_1': 'http://127.0.0.1:8010',
            'SERVICE_GUID_2': 'https://host-and-path-to-service'
          };
          return JSON.stringify(serviceMap);
        }
      }
    },
alanmoran commented 7 years ago

@wei-lee Should I now raise a PR for fh-mbaas-api to use this version? Or will it be picked up?

wei-lee commented 7 years ago

@alanmoran it is done now. You can use fh-mbaas-api@6.1.0

alanmoran commented 7 years ago

👍 Thanks @wei-lee