Merge pull request #10 from lolPants/feat/cors

Add CORS headers for Server List
This commit is contained in:
BobTheBob 2022-01-05 22:56:02 +00:00 committed by GitHub
commit 4a59ec16ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 0 deletions

View File

@ -2,6 +2,8 @@ const path = require( "path" )
const { GameServer, GetGameServers, RemoveGameServer } = require( path.join( __dirname, "../shared/gameserver.js" ) )
module.exports = ( fastify, opts, done ) => {
fastify.register(require( "fastify-cors" ))
// exported routes
// GET /client/servers

32
package-lock.json generated
View File

@ -10,6 +10,7 @@
"bad-words": "^3.0.4",
"dotenv": "^10.0.0",
"fastify": "^3.24.0",
"fastify-cors": "^6.0.2",
"fastify-multipart": "^5.1.0",
"sqlite3": "^5.0.2"
}
@ -433,6 +434,15 @@
"tiny-lru": "^7.0.0"
}
},
"node_modules/fastify-cors": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/fastify-cors/-/fastify-cors-6.0.2.tgz",
"integrity": "sha512-sE0AOyzmj5hLLRRVgenjA6G2iOGX35/1S3QGYB9rr9TXelMZB3lFrXy4CzwYVOMiujJeMiLgO4J7eRm8sQSv8Q==",
"dependencies": {
"fastify-plugin": "^3.0.0",
"vary": "^1.1.2"
}
},
"node_modules/fastify-error": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
@ -1587,6 +1597,14 @@
"uuid": "bin/uuid"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
@ -1983,6 +2001,15 @@
"tiny-lru": "^7.0.0"
}
},
"fastify-cors": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/fastify-cors/-/fastify-cors-6.0.2.tgz",
"integrity": "sha512-sE0AOyzmj5hLLRRVgenjA6G2iOGX35/1S3QGYB9rr9TXelMZB3lFrXy4CzwYVOMiujJeMiLgO4J7eRm8sQSv8Q==",
"requires": {
"fastify-plugin": "^3.0.0",
"vary": "^1.1.2"
}
},
"fastify-error": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/fastify-error/-/fastify-error-0.3.1.tgz",
@ -2918,6 +2945,11 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"optional": true
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",

View File

@ -11,6 +11,7 @@
"bad-words": "^3.0.4",
"dotenv": "^10.0.0",
"fastify": "^3.24.0",
"fastify-cors": "^6.0.2",
"fastify-multipart": "^5.1.0",
"sqlite3": "^5.0.2"
}