Skip to content

Commit

Permalink
Testing CORS enable
Browse files Browse the repository at this point in the history
  • Loading branch information
nmagee committed Nov 13, 2024
1 parent 0f8e806 commit 6aa76d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}

- name: Build and push
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: .
Expand Down
8 changes: 8 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from typing import Optional
from pydantic import BaseModel
import mysql.connector
Expand All @@ -19,6 +20,13 @@

app = FastAPI()

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

@app.get("/") # zone apex
def zone_apex():
return {"Good Day": "Sunshine!"}
Expand Down

0 comments on commit 6aa76d4

Please sign in to comment.