Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions material-react-app/.env.example

This file was deleted.

20,581 changes: 12,284 additions & 8,297 deletions material-react-app/package-lock.json

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions node-api/.env.example

This file was deleted.

2 changes: 1 addition & 1 deletion node-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dotenv": "^16.0.1",
"express": "^4.18.1",
"jsonwebtoken": "^8.5.1",
"mongoose": "^6.5.0",
"mongoose": "^6.12.6",
"mysql": "^2.18.1",
"mysql2": "^2.3.3",
"node-cron": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion node-api/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const app = express();
const whitelist = [process.env.APP_URL_CLIENT];
const corsOptions = {
origin: function (origin, callback) {
if (!origin || whitelist.indexOf(origin) !== -1) {
if (!origin !== -1) {
callback(null, true);
} else {
callback(new Error("Not allowed by CORS"));
Expand Down
1 change: 1 addition & 0 deletions node-api/src/mongo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ dotenv.config();

export const dbConnect = () => {
mongoose.connection.once("open", () => console.log("DB connection"));
console.log( `mongodb+srv://${process.env.DB_LINK}?retryWrites=true&w=majority`);
return mongoose.connect(
`mongodb+srv://${process.env.DB_LINK}?retryWrites=true&w=majority`,
{ keepAlive: true }
Expand Down
19 changes: 19 additions & 0 deletions node-api/src/mysql/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// config/db.js
const mysql = require('mysql2');

const connection = mysql.createConnection({
host: 'localhost',
user: 'your-username',
password: 'your-password',
database: 'your-database'
});

connection.connect((err) => {
if (err) {
console.error('Error connecting to MySQL:', err);
return;
}
console.log('Connected to MySQL database');
});

module.exports = connection;
6 changes: 6 additions & 0 deletions package-lock.json

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