#!/bin/bash

export DM_ENVIRONMENT=${DM_ENVIRONMENT:="local"}

export DM_API_DOMAIN=${DM_API_DOMAIN:=http://localhost:5000}
export DM_SEARCH_API_DOMAIN=${DM_SEARCH_API_DOMAIN:=http://localhost:5001}
export DM_FRONTEND_DOMAIN=${DM_FRONTEND_DOMAIN:=http://localhost}

source "${BASH_SOURCE%/*}/common.sh"

#!/bin/bash

export DM_ENVIRONMENT=${DM_ENVIRONMENT:="local"}

export DM_API_PORT=${DM_API_PORT:=5000}
export DM_SEARCH_API_PORT=${DM_SEARCH_API_PORT:=5001}

export DM_API_DOMAIN=${DM_API_DOMAIN:=http://localhost:${DM_API_PORT}}
export DM_SEARCH_API_DOMAIN=${DM_SEARCH_API_DOMAIN:=http://localhost:${DM_SEARCH_API_PORT}}
export DM_FRONTEND_DOMAIN=${DM_FRONTEND_DOMAIN:=http://localhost}

source "${BASH_SOURCE%/*}/common.sh"

Allow overriding development server port and api/search api ports
Allow overriding development server port and api/search api ports

There are times when we might want to change the port that the api or
search api server listens on in development mode; this commit makes this
easier by adding additional configuration variables `DM_API_PORT` and
`DM_SEARCH_API_PORT` that can be set in the environment. We then
construct the existing `DM_DATA_API_DOMAIN` and `DM_SEARCH_API_DOMAIN`
configuration variables from these.

The api and search api uses these same environment variables to
determine what port they listens on; see
alphagov/digitalmarketplace-search-api#241 and
alphagov/digitalmarketplace-api#986. This way we can change the entire
system by changing one environment variable.

This commit adds `DM_API_PORT` and `DM_SEARCH_API_PORT` to the
`config/local.example.sh` configuration file.
