This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install | |
| brew tap mongodb/brew | |
| brew install mongodb-community | |
| sudo su | |
| mkdir -p /data/db | |
| sudo chown -R `id -un` /data/db | |
| # Forground |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // import { MongoClient } from 'mongodb'; | |
| import dotenv from 'dotenv'; | |
| dotenv.config({ path: '../.env' }); | |
| import * as mongo from 'mongodb'; | |
| export class MongoHelper { | |
| public static client: mongo.MongoClient; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| https://github.com/tutumcloud/mongodb | |
| docker run -d -p 27017:27017 -p 28017:28017 -e MONGODB_USER="user" -e MONGODB_DATABASE="mydatabase" -e MONGODB_PASS="mypass" tutum/mongodb | |
| environment: | |
| MONGODB_USER: "${db_user_env}" | |
| MONGODB_DATABASE: "${dbname_env}" | |
| MONGODB_PASS: "${db_pass}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - ./databaseInit/mongoDB:/docker-entrypoint-initdb.d | |
| https://medium.com/faun/managing-mongodb-on-docker-with-docker-compose-26bf8a0bbae3 | |
| // init-mongo.js | |
| db.createUser({ | |
| user: 'gjermund', | |
| pwd: 'skobba' | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const MongoClient = require('mongodb').MongoClient; // eslint-disable-line import/no-extraneous-dependencies | |
| // Database Name | |
| const dbName = 'demo'; | |
| (async () => { | |
| const client = await MongoClient.connect( | |
| 'mongodb://mongouser:mongopass@localhost:27017/demo?authSource=demo' | |
| ); | |
| console.log('Connected successfully to server'); // eslint-disable-line no-console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { MongoClient } from 'mongodb'; // eslint-disable-line import/no-extraneous-dependencies | |
| const authSource = 'demo'; | |
| const url = `mongodb://${process.env.MONGO_USERNAME}:${process.env.MONGO_PASSWORD}@${process.env.MONGO_HOSTNAME}:${process.env.MONGO_PORT}/${authSource}?authSource=demo&authMechanism=SCRAM-SHA-1`; | |
| MongoClient.connect( | |
| url, | |
| { useNewUrlParser: true, useUnifiedTopology: true }, | |
| function(err, db) { | |
| if (err) throw err; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "executionRoleArn": null, | |
| "containerDefinitions": [ | |
| { | |
| "dnsSearchDomains": null, | |
| "logConfiguration": null, | |
| "entryPoint": null, | |
| "portMappings": [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "LineCount.excludes": [ | |
| "**/.vscode/**", | |
| "**/node_modules/**", | |
| "**/dist/**" | |
| ], | |
| "git.enableSmartCommit": true, | |
| "git.confirmSync": false, | |
| "window.zoomLevel": -1, | |
| "search.exclude": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */ | |
| html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { | |
| margin: 0; | |
| padding: 0; | |
| border: 0; | |
| font-size: 100%; | |
| font: inherit; | |
| vertical-align: baseline; | |
| } | |
| /* HTML5 display-role reset for older browsers */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "RFCTD": { | |
| "prefix": "gsrfctr", | |
| "body": [ | |
| "import * as React from 'react';", | |
| "", | |
| "interface FooterProps {", | |
| " name: string;", | |
| "}", | |
| "", |