feat: openapi cors

This commit is contained in:
archer
2023-05-19 12:01:59 +08:00
parent bb312441c6
commit 2843178ede
12 changed files with 71 additions and 209 deletions

View File

@@ -6,8 +6,9 @@ import { authToken } from '@/service/utils/auth';
import { generateVector } from '@/service/events/generateVector';
import { PgClient } from '@/service/pg';
import { authKb } from '@/service/utils/auth';
import { withNextCors } from '@/service/utils/tools';
export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
export default withNextCors(async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
try {
const {
kbId,
@@ -89,4 +90,4 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
error: err
});
}
}
});