update @koa/cors

This commit is contained in:
lik
2026-05-25 12:12:54 +08:00
parent 2c6efee887
commit 2245960ccf
3 changed files with 15 additions and 9 deletions

2
app.js
View File

@@ -1,6 +1,6 @@
import Koa from 'koa'; import Koa from 'koa';
import bodyParser from 'koa-bodyparser'; import bodyParser from 'koa-bodyparser';
import cors from 'koa-cors'; import cors from '@koa/cors';
import http from 'http'; import http from 'http';
import { DBModel } from './models/index.js'; import { DBModel } from './models/index.js';
import registerRoutes from './routes/index.js'; import registerRoutes from './routes/index.js';

20
package-lock.json generated
View File

@@ -8,9 +8,9 @@
"name": "api_user", "name": "api_user",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@koa/cors": "^5.0.0",
"koa": "^2.15.3", "koa": "^2.15.3",
"koa-bodyparser": "^4.4.1", "koa-bodyparser": "^4.4.1",
"koa-cors": "^0.0.16",
"koa-router": "^12.0.1", "koa-router": "^12.0.1",
"mongoose": "^8.4.0", "mongoose": "^8.4.0",
"node-fetch": "^3.3.2" "node-fetch": "^3.3.2"
@@ -25,6 +25,18 @@
"integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==", "integrity": "sha512-Waj1cwPXJDucOib4a3bAISsKJVb15MKi9IvmTI/7ssVEm6sywXGjVJDhl6/umt1pK1ZS7PacXU3A1PmFKHEZ2w==",
"license": "BSD-3-Clause" "license": "BSD-3-Clause"
}, },
"node_modules/@koa/cors": {
"version": "5.0.0",
"resolved": "https://registry.npmmirror.com/@koa/cors/-/cors-5.0.0.tgz",
"integrity": "sha512-x/iUDjcS90W69PryLDIMgFyV21YLTnG9zOpPXS7Bkt2b8AsY3zZsIpOLBkYr9fBcF3HbkKaER5hOBZLfpLgYNw==",
"license": "MIT",
"dependencies": {
"vary": "^1.1.2"
},
"engines": {
"node": ">= 14.0.0"
}
},
"node_modules/@mongodb-js/saslprep": { "node_modules/@mongodb-js/saslprep": {
"version": "1.4.11", "version": "1.4.11",
"resolved": "https://registry.npmmirror.com/@mongodb-js/saslprep/-/saslprep-1.4.11.tgz", "resolved": "https://registry.npmmirror.com/@mongodb-js/saslprep/-/saslprep-1.4.11.tgz",
@@ -806,12 +818,6 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/koa-cors": {
"version": "0.0.16",
"resolved": "https://registry.npmmirror.com/koa-cors/-/koa-cors-0.0.16.tgz",
"integrity": "sha512-s15knPxe3AJBi2I/ZMPL0pSqU+PLYLO6k5tI0AqClkzavowvocPlSdFUwaHNqtjHMhsGmiq2tiX/25iILJx9YA==",
"license": "MIT"
},
"node_modules/koa-router": { "node_modules/koa-router": {
"version": "12.0.1", "version": "12.0.1",
"resolved": "https://registry.npmmirror.com/koa-router/-/koa-router-12.0.1.tgz", "resolved": "https://registry.npmmirror.com/koa-router/-/koa-router-12.0.1.tgz",

View File

@@ -11,7 +11,7 @@
"dependencies": { "dependencies": {
"koa": "^2.15.3", "koa": "^2.15.3",
"koa-bodyparser": "^4.4.1", "koa-bodyparser": "^4.4.1",
"koa-cors": "^0.0.16", "@koa/cors": "^5.0.0",
"koa-router": "^12.0.1", "koa-router": "^12.0.1",
"mongoose": "^8.4.0", "mongoose": "^8.4.0",
"node-fetch": "^3.3.2" "node-fetch": "^3.3.2"