Skip to content

Commit

Permalink
Merge pull request #29 from Robin5605/cors
Browse files Browse the repository at this point in the history
Add wildcard CORS
  • Loading branch information
shenanigansd authored Mar 12, 2023
2 parents a23b4aa + a7580fd commit 32d9f6a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Changelog
=========
- :release:`1.8.1 <11th March 2023>`
- :feature:`28` CORS

- :release:`1.8.0 <11th March 2023>`
- :feature:`26` Move random number generation to generators module
Expand Down
2 changes: 1 addition & 1 deletion src/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Public API for our projects"""

__version__ = "1.8.0"
__version__ = "1.8.1"
8 changes: 8 additions & 0 deletions src/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import sentry_sdk
from fastapi import APIRouter, FastAPI
from fastapi.middleware.cors import CORSMiddleware
from imsosorry import uwuify

# pylint: disable-next=no-name-in-module
Expand Down Expand Up @@ -38,6 +39,13 @@ class TextModel(BaseModel):
version=__version__,
)

app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_methods=["*"],
allow_headers=["*"],
)

router_root = APIRouter()


Expand Down

0 comments on commit 32d9f6a

Please sign in to comment.