Skip to content

Commit

Permalink
Change local development port to 5050 and record change in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Apophenia committed Feb 1, 2024
1 parent 3a31c81 commit 77a781f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Added
New /fulfill endpoint with ability to check for NYPL login in Bearer authorization header
Fulfill endpoint returns pre-signed URLs for objects in private buckets when user is logged in
Change default development port to 5050 due to macOS Monterey and higher occupying port 5000 by default

## unreleased version -- v0.12.4
## Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ To set up a local environment there is a special process to initialize a databas

You can find the values to these variables from the HathiTrust website (https://babel.hathitrust.org/cgi/kgs/request) and OCLC website (https://www.oclc.org/developer/api/keys.en.html) or ask other developers for assistance on attaining these values.

With the configurations set, one of these commands should be run: `make up` or `docker compose up`. These commands will run the docker-compose file in the codebase and this is why it's required to have Docker/Docker Desktop installed locally. After running one of the commands, a short import process will occur and populate the database with some sample data alongside running the API locally. This will allow you to query the API at `localhost:5000` and query the ESC at `localhost:9200`.
With the configurations set, one of these commands should be run: `make up` or `docker compose up`. These commands will run the docker-compose file in the codebase and this is why it's required to have Docker/Docker Desktop installed locally. After running one of the commands, a short import process will occur and populate the database with some sample data alongside running the API locally. This will allow you to query the API at `localhost:5050` and query the ESC at `localhost:9200`.

The docker compose file uses the sample-compose.yaml file in the `config` directory and additional configurations and dependencies can be added to the file to build upon your local environment.

Expand Down
8 changes: 4 additions & 4 deletions api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ def __init__(self, dbEngine, redisClient):

def run(self):
if 'local-compose' in os.environ['ENVIRONMENT'] or 'sample-compose' in os.environ['ENVIRONMENT']:
logger.debug('Starting dev server on port 5000')
logger.debug('Starting dev server on port 5050')

self.app.config['ENV'] = 'development'
self.app.config['DEBUG'] = True
self.app.run(host='0.0.0.0')
self.app.run(host='0.0.0.0', port=5050)

elif 'local' in os.environ['ENVIRONMENT']:
logger.debug('Starting dev server on port 5000')
logger.debug('Starting dev server on port 5050')

self.app.config['ENV'] = 'development'
self.app.config['DEBUG'] = True
self.app.run()
self.app.run(port=5050)
else:
logger.debug('Starting production server on port 80')

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
context: .
command: -e local-compose -p APIProcess
ports:
- 5000:5000
- 5050:5050
volumes:
- type: bind
source: .
Expand Down

0 comments on commit 77a781f

Please sign in to comment.