first commit

This commit is contained in:
2026-08-08 00:15:48 +03:00
parent ac2bc13da0
commit d98b4c1343
146 changed files with 122827 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
const allowedOrigins = process.env.ALLOWED_ORIGINS.split(',').map(origin => origin.trim());
module.exports = {
origin: function(origin, callback) {
if (!origin) return callback(null, true);
if (allowedOrigins.includes(origin)) {
return callback(null, true);
}
return callback(new Error('CORS: Origin not allowed'), false);
},
credentials: true
};
+22
View File
@@ -0,0 +1,22 @@
const session = require('express-session');
const MySQLStore = require('express-mysql-session')(session);
module.exports = (session) => {
return {
secret: process.env.SECRET_KEY || 'mhmh4563463fds',
resave: false,
saveUninitialized: false,
store: new MySQLStore({
host: process.env.MYSQL_HOST,
port: process.env.MYSQL_PORT,
user: process.env.MYSQL_USER,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE
}),
cookie: {
secure: false,
httpOnly: true,
maxAge: 10 * 60 * 60 * 1000
}
};
};