Skip to content

Commit

Permalink
release: v0.0.11 (#45)
Browse files Browse the repository at this point in the history
* fix: Enable all CORS origins (#44)

* chore: Remove origins environment variable

* fix: Enable all origins in CORS config
  • Loading branch information
PedroChaparro authored Oct 11, 2023
1 parent 8417cac commit 325be03
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### 0.0.11 (2023-10-11)

### 0.0.10 (2023-10-11)


### Bug Fixes

* Enable all CORS origins ([#44](https://github.com/hawks-atlanta/proxy-python/issues/44)) ([9f8ad6a](https://github.com/hawks-atlanta/proxy-python/commit/9f8ad6ae4dee09b18bd7e1f44d36f0c0ee7f4ced))

### 0.0.9 (2023-10-09)


Expand Down
7 changes: 3 additions & 4 deletions CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ This document describes how to use the service as a CLI tool.

## Environment variables

| Variable | Description | Example |
| ----------------- | ------------------------------------------------------ | ------------------------------------------ |
| `GATEWAY_BASEURL` | Base URL of the gateway | `https://gateway:8080` |
| `ALLOWED_ORIGINS` | An string with the allowed origins separated by commas | `https://example.com,https://example2.com` |
| Variable | Description | Example |
| ----------------- | ----------------------- | ---------------------- |
| `GATEWAY_BASEURL` | Base URL of the gateway | `https://gateway:8080` |
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ COPY . .
USER application
RUN pip install -r requirements.txt
ENV GATEWAY_BASEURL "http://gateway:8080"
ENV ALLOWED_ORIGINS "http://localhost:5173"
ENTRYPOINT ["python", "-m", "flask", "-A", "./main.py", "run", "--host", "0.0.0.0", "--port", "8080"]
6 changes: 1 addition & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import flask
from flask_cors import CORS
from src.views import views
from src.config.environment import variables

app = flask.Flask(__name__)
app.register_blueprint(views)

allowed_origins_list = variables["ALLOWED_ORIGINS"].split(",")

CORS(app, resources={r"/*": {"origins": allowed_origins_list}})
CORS(app, resources={r"/*": {"origins": "*"}})

if __name__ == "__main__":
app.run(debug=True)
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"git-semver-tags": "^4.1.1",
"standard-version": "^9.5.0"
},
"version": "0.0.9"
"version": "0.0.11"
}
1 change: 0 additions & 1 deletion src/config/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

variables = {
"GATEWAY_BASEURL": os.getenv("GATEWAY_BASEURL", "http://localhost:8080"),
"ALLOWED_ORIGINS": os.getenv("ALLOWED_ORIGINS", "http://localhost:5173"),
}

0 comments on commit 325be03

Please sign in to comment.