Setting allowed domain to app
continuous-integration/drone/push Build is passing Details

main
Félix MIELCAREK 11 months ago
parent e938e6f07b
commit 201ac2181c

@ -2,6 +2,7 @@
const express = require('express') const express = require('express')
const axios = require('axios'); const axios = require('axios');
const mariadb = require('mariadb'); const mariadb = require('mariadb');
const cors = require('cors');
//#endregion //#endregion
//#region CONSTANTS //#region CONSTANTS
@ -9,6 +10,7 @@ const port = 80
const clientId = process.env.CLIENT_ID; const clientId = process.env.CLIENT_ID;
const clientSecret = process.env.CLIENT_SECRET; const clientSecret = process.env.CLIENT_SECRET;
const redirectUri = 'https://felixmielcarek.github.io/callback/'; const redirectUri = 'https://felixmielcarek.github.io/callback/';
const allowedDomain = [ 'https://felixmielcarek.github.io' ];
//#endregion //#endregion
//#region LOGS //#region LOGS
@ -20,6 +22,7 @@ function stepBeggining(step) {
//#region APP INIT //#region APP INIT
const app = express() const app = express()
app.use(cors({ origin: allowedDomain }));
app.listen(port, () => { console.log(`Big brother is listening on port ${port}`) }) app.listen(port, () => { console.log(`Big brother is listening on port ${port}`) })
//#endregion //#endregion

@ -10,6 +10,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^1.6.7", "axios": "^1.6.7",
"cors": "^2.8.5",
"express": "^4.18.3", "express": "^4.18.3",
"mariadb": "^3.3.0" "mariadb": "^3.3.0"
} }
@ -151,6 +152,18 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
}, },
"node_modules/cors": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"dependencies": {
"object-assign": "^4",
"vary": "^1"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/debug": { "node_modules/debug": {
"version": "2.6.9", "version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@ -577,6 +590,14 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/object-inspect": { "node_modules/object-inspect": {
"version": "1.13.1", "version": "1.13.1",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz",

@ -11,6 +11,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^1.6.7", "axios": "^1.6.7",
"cors": "^2.8.5",
"express": "^4.18.3", "express": "^4.18.3",
"mariadb": "^3.3.0" "mariadb": "^3.3.0"
} }

Loading…
Cancel
Save