feat(Packagers): testing out fastapi for performance

This commit is contained in:
darkicewolf50 2024-11-27 17:58:01 -07:00 committed by GitHub
parent 72fc3602d9
commit 0276fea6e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,4 +14,34 @@ def index(request):
response['X-IsBase64Encoded'] = 'false' # Custom header to indicate base64 encoding
response.status_code = 200
return response
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI()
@app.get("/")
async def index():
ymlschedule = {"message": False}
# Create the response body with multiple items
res = {
"body": {
"Schedule": ymlschedule, # FastAPI will automatically serialize the dictionary
"message": "good",
}
}
# Set custom headers
headers = {
"isBase64Encoded": "false", # Custom header
}
# Return the response with the custom header
return JSONResponse(
content=res,
headers=headers,
# status_code=200 commented out just to show how to change it if you wanted
)
'''