This file contains 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 mongoose = require('mongoose') | |
const { MongoMemoryServer } = require('mongodb-memory-server') | |
const User = require('./user.model') | |
const Post = require('./post.model') | |
const start = async () => { | |
// connect to a mongo database | |
const mongodb = new MongoMemoryServer() | |
const connectionUri = await mongodb.getUri() |
This file contains 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 mongoose = require('mongoose') | |
const schema = require('gridfile') | |
module.exports = mongoose.model('Attachment', schema, 'attachment.files') |
This file contains 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 express = require('express') | |
const multer = require('multer') | |
const path = require('path') | |
const fs = require('fs') | |
const mongoose = require('mongoose') | |
const { MongoMemoryServer } = require('mongodb-memory-server') | |
const GridFile = require('./gridfile.model') | |
const upload = multer({ dest: path.join(__dirname, '.') }) |
This file contains 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 express = require('express') | |
const app = express() | |
const port = 3000 | |
/** | |
* Express middleware to log request and response headers | |
*/ | |
app.use((req, res, nxt) => { | |
const requestHeaders = req.headers |
This file contains 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
//Reference: http://www.geeksforgeeks.org/graph-and-its-representations/ | |
import java.util.*; | |
public class Graph { | |
List<Integer> vertices[]; | |
public Graph(int count){ | |
vertices = new ArrayList[count]; | |
for(int i = 0; i < count; i++){ |