Spaces:
Paused
Paused
Soham Waghmare
commited on
Commit
·
501bdbe
1
Parent(s):
b9744a3
fix: cors
Browse files- backend/app.py +6 -4
- backend/pyproject.toml +1 -1
- backend/uv.lock +0 -0
- frontend/bun.lock +12 -12
backend/app.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
# pip install asyncio eventlet
|
| 2 |
-
# pip install google-genai beautifulsoup4 selenium newspaper3k lxml_html_clean
|
| 3 |
import json
|
| 4 |
import logging
|
| 5 |
from typing import Dict
|
|
@@ -20,15 +18,19 @@ logging.basicConfig(level=logging.INFO)
|
|
| 20 |
logger = logging.getLogger(__name__)
|
| 21 |
|
| 22 |
app = FastAPI()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
app.add_middleware(
|
| 24 |
CORSMiddleware,
|
| 25 |
-
allow_origins=
|
| 26 |
allow_credentials=True,
|
| 27 |
allow_methods=["*"],
|
| 28 |
allow_headers=["*"],
|
| 29 |
)
|
| 30 |
|
| 31 |
-
sio = socketio.AsyncServer(cors_allowed_origins=
|
| 32 |
app.mount("/", socketio.ASGIApp(sio))
|
| 33 |
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 1 |
import json
|
| 2 |
import logging
|
| 3 |
from typing import Dict
|
|
|
|
| 18 |
logger = logging.getLogger(__name__)
|
| 19 |
|
| 20 |
app = FastAPI()
|
| 21 |
+
CORS_ALLOWED_ORIGINS = [
|
| 22 |
+
"*",
|
| 23 |
+
"https://knowledge-net.vercel.app",
|
| 24 |
+
]
|
| 25 |
app.add_middleware(
|
| 26 |
CORSMiddleware,
|
| 27 |
+
allow_origins=CORS_ALLOWED_ORIGINS,
|
| 28 |
allow_credentials=True,
|
| 29 |
allow_methods=["*"],
|
| 30 |
allow_headers=["*"],
|
| 31 |
)
|
| 32 |
|
| 33 |
+
sio = socketio.AsyncServer(cors_allowed_origins=CORS_ALLOWED_ORIGINS, ping_timeout=60, ping_interval=10, async_mode="asgi")
|
| 34 |
app.mount("/", socketio.ASGIApp(sio))
|
| 35 |
|
| 36 |
|
backend/pyproject.toml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
name = "backend"
|
| 3 |
version = "0.1.0"
|
| 4 |
description = "Add your description here"
|
| 5 |
-
requires-python = ">=3.
|
| 6 |
dependencies = [
|
| 7 |
"aiofiles==24.1.0",
|
| 8 |
"aiohappyeyeballs==2.4.5",
|
|
|
|
| 2 |
name = "backend"
|
| 3 |
version = "0.1.0"
|
| 4 |
description = "Add your description here"
|
| 5 |
+
requires-python = ">=3.11.5"
|
| 6 |
dependencies = [
|
| 7 |
"aiofiles==24.1.0",
|
| 8 |
"aiohappyeyeballs==2.4.5",
|
backend/uv.lock
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
frontend/bun.lock
CHANGED
|
@@ -18,7 +18,7 @@
|
|
| 18 |
"class-variance-authority": "^0.7.1",
|
| 19 |
"clsx": "^2.1.1",
|
| 20 |
"lucide-react": "^0.479.0",
|
| 21 |
-
"next": "14.2.
|
| 22 |
"next-themes": "^0.4.5",
|
| 23 |
"react": "^18",
|
| 24 |
"react-dom": "^18",
|
|
@@ -133,25 +133,25 @@
|
|
| 133 |
|
| 134 |
"@mswjs/interceptors": ["@mswjs/interceptors@0.37.6", "", { "dependencies": { "@open-draft/deferred-promise": "^2.2.0", "@open-draft/logger": "^0.3.0", "@open-draft/until": "^2.0.0", "is-node-process": "^1.2.0", "outvariant": "^1.4.3", "strict-event-emitter": "^0.5.1" } }, "sha512-wK+5pLK5XFmgtH3aQ2YVvA3HohS3xqV/OxuVOdNx9Wpnz7VE/fnC+e1A7ln6LFYeck7gOJ/dsZV6OLplOtAJ2w=="],
|
| 135 |
|
| 136 |
-
"@next/env": ["@next/env@14.2.
|
| 137 |
|
| 138 |
-
"@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@14.2.
|
| 139 |
|
| 140 |
-
"@next/swc-darwin-x64": ["@next/swc-darwin-x64@14.2.
|
| 141 |
|
| 142 |
-
"@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@14.2.
|
| 143 |
|
| 144 |
-
"@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@14.2.
|
| 145 |
|
| 146 |
-
"@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@14.2.
|
| 147 |
|
| 148 |
-
"@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@14.2.
|
| 149 |
|
| 150 |
-
"@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@14.2.
|
| 151 |
|
| 152 |
-
"@next/swc-win32-ia32-msvc": ["@next/swc-win32-ia32-msvc@14.2.
|
| 153 |
|
| 154 |
-
"@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@14.2.
|
| 155 |
|
| 156 |
"@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
|
| 157 |
|
|
@@ -669,7 +669,7 @@
|
|
| 669 |
|
| 670 |
"nanoid": ["nanoid@3.3.8", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="],
|
| 671 |
|
| 672 |
-
"next": ["next@14.2.
|
| 673 |
|
| 674 |
"next-themes": ["next-themes@0.4.5", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-E8/gYKBxZknOXBiDk/sRokAvkOw35PTUD4Gxtq1eBhd0r4Dx5S42zU65/q8ozR5rcSG2ZlE1E3+ShlUpC7an+A=="],
|
| 675 |
|
|
|
|
| 18 |
"class-variance-authority": "^0.7.1",
|
| 19 |
"clsx": "^2.1.1",
|
| 20 |
"lucide-react": "^0.479.0",
|
| 21 |
+
"next": "14.2.25",
|
| 22 |
"next-themes": "^0.4.5",
|
| 23 |
"react": "^18",
|
| 24 |
"react-dom": "^18",
|
|
|
|
| 133 |
|
| 134 |
"@mswjs/interceptors": ["@mswjs/interceptors@0.37.6", "", { "dependencies": { "@open-draft/deferred-promise": "^2.2.0", "@open-draft/logger": "^0.3.0", "@open-draft/until": "^2.0.0", "is-node-process": "^1.2.0", "outvariant": "^1.4.3", "strict-event-emitter": "^0.5.1" } }, "sha512-wK+5pLK5XFmgtH3aQ2YVvA3HohS3xqV/OxuVOdNx9Wpnz7VE/fnC+e1A7ln6LFYeck7gOJ/dsZV6OLplOtAJ2w=="],
|
| 135 |
|
| 136 |
+
"@next/env": ["@next/env@14.2.25", "", {}, "sha512-JnzQ2cExDeG7FxJwqAksZ3aqVJrHjFwZQAEJ9gQZSoEhIow7SNoKZzju/AwQ+PLIR4NY8V0rhcVozx/2izDO0w=="],
|
| 137 |
|
| 138 |
+
"@next/swc-darwin-arm64": ["@next/swc-darwin-arm64@14.2.25", "", { "os": "darwin", "cpu": "arm64" }, "sha512-09clWInF1YRd6le00vt750s3m7SEYNehz9C4PUcSu3bAdCTpjIV4aTYQZ25Ehrr83VR1rZeqtKUPWSI7GfuKZQ=="],
|
| 139 |
|
| 140 |
+
"@next/swc-darwin-x64": ["@next/swc-darwin-x64@14.2.25", "", { "os": "darwin", "cpu": "x64" }, "sha512-V+iYM/QR+aYeJl3/FWWU/7Ix4b07ovsQ5IbkwgUK29pTHmq+5UxeDr7/dphvtXEq5pLB/PucfcBNh9KZ8vWbug=="],
|
| 141 |
|
| 142 |
+
"@next/swc-linux-arm64-gnu": ["@next/swc-linux-arm64-gnu@14.2.25", "", { "os": "linux", "cpu": "arm64" }, "sha512-LFnV2899PJZAIEHQ4IMmZIgL0FBieh5keMnriMY1cK7ompR+JUd24xeTtKkcaw8QmxmEdhoE5Mu9dPSuDBgtTg=="],
|
| 143 |
|
| 144 |
+
"@next/swc-linux-arm64-musl": ["@next/swc-linux-arm64-musl@14.2.25", "", { "os": "linux", "cpu": "arm64" }, "sha512-QC5y5PPTmtqFExcKWKYgUNkHeHE/z3lUsu83di488nyP0ZzQ3Yse2G6TCxz6nNsQwgAx1BehAJTZez+UQxzLfw=="],
|
| 145 |
|
| 146 |
+
"@next/swc-linux-x64-gnu": ["@next/swc-linux-x64-gnu@14.2.25", "", { "os": "linux", "cpu": "x64" }, "sha512-y6/ML4b9eQ2D/56wqatTJN5/JR8/xdObU2Fb1RBidnrr450HLCKr6IJZbPqbv7NXmje61UyxjF5kvSajvjye5w=="],
|
| 147 |
|
| 148 |
+
"@next/swc-linux-x64-musl": ["@next/swc-linux-x64-musl@14.2.25", "", { "os": "linux", "cpu": "x64" }, "sha512-sPX0TSXHGUOZFvv96GoBXpB3w4emMqKeMgemrSxI7A6l55VBJp/RKYLwZIB9JxSqYPApqiREaIIap+wWq0RU8w=="],
|
| 149 |
|
| 150 |
+
"@next/swc-win32-arm64-msvc": ["@next/swc-win32-arm64-msvc@14.2.25", "", { "os": "win32", "cpu": "arm64" }, "sha512-ReO9S5hkA1DU2cFCsGoOEp7WJkhFzNbU/3VUF6XxNGUCQChyug6hZdYL/istQgfT/GWE6PNIg9cm784OI4ddxQ=="],
|
| 151 |
|
| 152 |
+
"@next/swc-win32-ia32-msvc": ["@next/swc-win32-ia32-msvc@14.2.25", "", { "os": "win32", "cpu": "ia32" }, "sha512-DZ/gc0o9neuCDyD5IumyTGHVun2dCox5TfPQI/BJTYwpSNYM3CZDI4i6TOdjeq1JMo+Ug4kPSMuZdwsycwFbAw=="],
|
| 153 |
|
| 154 |
+
"@next/swc-win32-x64-msvc": ["@next/swc-win32-x64-msvc@14.2.25", "", { "os": "win32", "cpu": "x64" }, "sha512-KSznmS6eFjQ9RJ1nEc66kJvtGIL1iZMYmGEXsZPh2YtnLtqrgdVvKXJY2ScjjoFnG6nGLyPFR0UiEvDwVah4Tw=="],
|
| 155 |
|
| 156 |
"@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],
|
| 157 |
|
|
|
|
| 669 |
|
| 670 |
"nanoid": ["nanoid@3.3.8", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="],
|
| 671 |
|
| 672 |
+
"next": ["next@14.2.25", "", { "dependencies": { "@next/env": "14.2.25", "@swc/helpers": "0.5.5", "busboy": "1.6.0", "caniuse-lite": "^1.0.30001579", "graceful-fs": "^4.2.11", "postcss": "8.4.31", "styled-jsx": "5.1.1" }, "optionalDependencies": { "@next/swc-darwin-arm64": "14.2.25", "@next/swc-darwin-x64": "14.2.25", "@next/swc-linux-arm64-gnu": "14.2.25", "@next/swc-linux-arm64-musl": "14.2.25", "@next/swc-linux-x64-gnu": "14.2.25", "@next/swc-linux-x64-musl": "14.2.25", "@next/swc-win32-arm64-msvc": "14.2.25", "@next/swc-win32-ia32-msvc": "14.2.25", "@next/swc-win32-x64-msvc": "14.2.25" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "react": "^18.2.0", "react-dom": "^18.2.0", "sass": "^1.3.0" }, "optionalPeers": ["@opentelemetry/api", "@playwright/test", "sass"], "bin": { "next": "dist/bin/next" } }, "sha512-N5M7xMc4wSb4IkPvEV5X2BRRXUmhVHNyaXwEM86+voXthSZz8ZiRyQW4p9mwAoAPIm6OzuVZtn7idgEJeAJN3Q=="],
|
| 673 |
|
| 674 |
"next-themes": ["next-themes@0.4.5", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-E8/gYKBxZknOXBiDk/sRokAvkOw35PTUD4Gxtq1eBhd0r4Dx5S42zU65/q8ozR5rcSG2ZlE1E3+ShlUpC7an+A=="],
|
| 675 |
|