mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
perf: Uvicorn bind template
This commit is contained in:
@@ -6,7 +6,20 @@ wlist = [
|
||||
"/docs",
|
||||
"/login/*",
|
||||
"*.json",
|
||||
"*.ico"
|
||||
"*.ico",
|
||||
"*.html",
|
||||
"*.js",
|
||||
"*.css",
|
||||
"*.png",
|
||||
"*.jpg",
|
||||
"*.jpeg",
|
||||
"*.gif",
|
||||
"*.svg",
|
||||
"*.woff",
|
||||
"*.woff2",
|
||||
"*.ttf",
|
||||
"*.eot",
|
||||
"*.otf"
|
||||
]
|
||||
|
||||
class WhitelistChecker:
|
||||
|
||||
+3
-1
@@ -1,3 +1,4 @@
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
import sentry_sdk
|
||||
from fastapi import FastAPI
|
||||
from fastapi.routing import APIRoute
|
||||
@@ -28,9 +29,10 @@ if settings.all_cors_origins:
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
app.add_middleware(TokenMiddleware)
|
||||
app.include_router(api_router, prefix=settings.API_V1_STR)
|
||||
|
||||
app.mount("/", StaticFiles(directory='../frontend/dist'), name="static")
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
|
||||
@@ -1,2 +1,2 @@
|
||||
VITE_API_BASE_URL=./
|
||||
VITE_API_BASE_URL=./api/v1
|
||||
VITE_APP_TITLE=SQLBot
|
||||
@@ -19,6 +19,7 @@ export const watchRouter = (router: any) => {
|
||||
return
|
||||
}
|
||||
if (to.path === '/login') {
|
||||
console.log(from)
|
||||
next('/chat')
|
||||
} else {
|
||||
next()
|
||||
|
||||
@@ -167,7 +167,7 @@ const search = () => {
|
||||
})
|
||||
}
|
||||
const addTerm = () => {
|
||||
termApi.add(state.form).then((res: any) => {
|
||||
termApi.add(state.form).then(() => {
|
||||
dialogFormVisible.value = false
|
||||
search()
|
||||
ElMessage({
|
||||
|
||||
Reference in New Issue
Block a user