Skip to content

Commit

Permalink
Add PORT and Procfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijay Kurian committed Nov 28, 2019
1 parent 94465ab commit 1be54df
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export FLASK_ENV=development
export FLASK_ENV_TEST=test
export DATABASE_URL="postgres://localhost/sportsmatch_api_db"
export JWT_SECRET_KEY=fredperry
export TEST_DATABASE_URL="postgres://localhost/sportsmatch_api_test_db"
export TEST_DATABASE_URL="postgres://localhost/sportsmatch_api_test_db"
export FLASK_RUN_PORT=5000
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ sqlalchemy-utils = "*"
codecov = "*"
pytest-cov = "*"
pytest = "*"
gunicorn = "*"

[requires]
python_version = "3.7"
16 changes: 12 additions & 4 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn run:app
2 changes: 2 additions & 0 deletions migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from alembic import context



# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
Expand Down
8 changes: 5 additions & 3 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

from src.app import create_app

env_name = os.getenv('FLASK_ENV')
app = create_app(env_name)

if __name__ == '__main__':
env_name = os.getenv('FLASK_ENV')
app = create_app(env_name)
port = os.getenv('PORT')
# run app
app.run()
app.run(host='https://localhost:5000', port=port)

0 comments on commit 1be54df

Please sign in to comment.