Skip to content

Instantly share code, notes, and snippets.

View hackinf0's full-sized avatar
🎯
Focusing

HACKINFO hackinf0

🎯
Focusing
View GitHub Profile
@hackinf0
hackinf0 / afile.txt
Last active January 28, 2024 15:10
Cookie not being set in production
Hello everyone, today I'll demonstrate how to troubleshoot the issue where the cookie is
being successfully set in development environments but not in production.
Suppose that in you server you are sending the cookie in the res like bellow:
@hackinf0
hackinf0 / Connecting Multiple Database in NodeJs with MongoDB and Mongoose
Last active October 2, 2024 08:52
Connecting Multiple Database in NodeJs with MongoDB and Mongoose
Explanation file: db.js
This code imports the mongoose library which allows to connect to a MongoDB database.
There are two URIs defined to connect to two different databases: MONGO_URI and MOBILE_URI.
Each URI contains connection information to a remote MongoDB database, including user credentials.
The connectDBs function uses the mongoose.createConnection method to create connections to these two
databases using the respective URIs. The useUnifiedTopology and useNewUrlParser options are set to enable the new
unified topology policy and use MongoDB's new URL parser, respectively.
The function returns an object that contains the connections to these two databases as qrCodeDb and userDB properties.