Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hhdst committed Sep 3, 2024
0 parents commit 47ae067
Show file tree
Hide file tree
Showing 9 changed files with 108,210 additions and 0 deletions.
Empty file added .gitcreated
Empty file.
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

/push.exe
187 changes: 187 additions & 0 deletions package-lock.json

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

17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"dependencies": {
"@types/figlet": "^1.5.8",
"@types/mongodb": "^4.0.7",
"@types/ws": "^8.5.12",
"dotenv": "^16.4.5",
"figlet": "^1.7.0",
"kleur": "^4.1.5",
"mongodb": "^6.8.0",
"rage-edit": "^1.2.0",
"tslib": "^2.7.0",
"ws": "^8.18.0"
},
"devDependencies": {
"@types/node": "^22.5.1"
}
}
50 changes: 50 additions & 0 deletions run.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@

process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0';
import fs from 'fs'
import { MongoClient } from 'mongodb'
import dotenv from 'dotenv'
import path from 'path'

const envPath = path.resolve(__dirname, '.env.local');
if (fs.existsSync(envPath)) {
dotenv.config({ path: envPath });
};

(async () => {

const client = new MongoClient(process.env.MONGOURL);

try {
await client.connect();
console.log('Connected to the MongoDB server');
const db = client.db(process.env.MONGODB_DB);

let t = await db.collection("test")
let result = await t.insertMany([{
fname:"ali",
lname:"akbari",
age:22,
blance:1500
},
{
fname:"hasan",
lname:"akbari",
age:22,
blance:1500
},
{
fname:"kamran",
lname:"akbari",
age:22,
blance:1500


}])
console.log(result)
} catch {
console.log("Failed to connect to Mongo Server.")
}
})()



Binary file added setup.exe
Binary file not shown.
Loading

0 comments on commit 47ae067

Please sign in to comment.