Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
shba007 committed Jun 21, 2023
2 parents dc10831 + 3b56390 commit 5a7d4ca
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 43 deletions.
9 changes: 7 additions & 2 deletions middleware/cors.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@

const config = useRuntimeConfig()

export default defineEventHandler((event) => {
const origins: string[] = config.corsUrl

const origin: string = event.node.req.headers.origin
const selectedOrigin = origins.findIndex((o) => o == origin)
// console.log({ origins, origin, selectedOrigin });

setResponseHeaders(event, {
"Access-Control-Allow-Methods": "GET,HEAD,PUT,PATCH,POST,DELETE",
"Access-Control-Allow-Origin": config.corsUrl,
"Access-Control-Allow-Origin": selectedOrigin !== -1 ? origins[selectedOrigin] : origins[0],
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Headers": "*",
"Access-Control-Expose-Headers": "*"
Expand Down
78 changes: 39 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"start": "node .output/server/index.mjs"
},
"devDependencies": {
"@types/node": "^20.2.5"
"@types/node": "^20.3.1"
},
"dependencies": {
"@qdrant/js-client-rest": "^1.2.2",
"@tensorflow/tfjs": "^4.6.0",
"@tensorflow/tfjs": "^4.7.0",
"firebase-admin": "^11.9.0",
"meilisearch": "0.33.0",
"nitropack": "^2.4.1",
Expand Down

0 comments on commit 5a7d4ca

Please sign in to comment.