-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e4702c
commit edc6843
Showing
4 changed files
with
48 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
|
||
import sentry_sdk | ||
from fastapi import APIRouter, FastAPI | ||
from fastapi.middleware.cors import CORSMiddleware | ||
from fastapi.responses import PlainTextResponse | ||
from fastapi_pagination import add_pagination | ||
from opentelemetry import trace | ||
|
@@ -195,17 +196,37 @@ async def lifespan(app: FastAPI): | |
{"url": "http://127.0.0.1:8000", "description": "Local Development Server"}, | ||
{"url": "https:/demo.honcho.dev", "description": "Demo Server"}, | ||
], | ||
title="Honcho API", | ||
summary="An API for adding personalization to AI Apps", | ||
description="""This API is used to store data and get insights about users for AI | ||
applications""", | ||
version="0.1.0", | ||
title="Honcho API", | ||
contact={ | ||
"name": "Plastic Labs", | ||
"url": "https://plasticlabs.ai", | ||
"email": "[email protected]", | ||
}, | ||
license_info={ | ||
"name": "GNU Affero General Public License v3.0", | ||
"identifier": "AGPL-3.0-only", | ||
"url": "https://github.com/plastic-labs/honcho/blob/main/LICENSE", | ||
}, | ||
) | ||
|
||
origins = ["http://localhost", "http://127.0.0.1:8000", "https://demo.honcho.dev"] | ||
|
||
app.add_middleware( | ||
CORSMiddleware, | ||
allow_origins=origins, | ||
allow_credentials=True, | ||
allow_methods=["*"], | ||
allow_headers=["*"], | ||
) | ||
|
||
|
||
if OPENTELEMTRY_ENABLED: | ||
FastAPIInstrumentor().instrument_app(app) | ||
|
||
|
||
router = APIRouter(prefix="/apps/{app_id}/users/{user_id}") | ||
|
||
# Create a Limiter instance | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters