mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-23 17:19:18 +02:00
some progress
This commit is contained in:
parent
aea93a5527
commit
e3c15bd288
1388 changed files with 306946 additions and 68323 deletions
31
node_modules/mongoose/tools/auth.js
generated
vendored
Normal file
31
node_modules/mongoose/tools/auth.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
|
||||
const Server = require('mongodb-topology-manager').Server;
|
||||
const mongodb = require('mongodb');
|
||||
|
||||
run().catch(error => {
|
||||
console.error(error);
|
||||
process.exit(-1);
|
||||
});
|
||||
|
||||
async function run() {
|
||||
// Create new instance
|
||||
const server = new Server('mongod', {
|
||||
auth: null,
|
||||
dbpath: '/data/db/27017'
|
||||
});
|
||||
|
||||
// Purge the directory
|
||||
await server.purge();
|
||||
|
||||
// Start process
|
||||
await server.start();
|
||||
|
||||
const db = await mongodb.MongoClient.connect('mongodb://127.0.0.1:27017/admin');
|
||||
|
||||
await db.addUser('passwordIsTaco', 'taco', {
|
||||
roles: ['dbOwner']
|
||||
});
|
||||
|
||||
console.log('done');
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue