File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package-lock.json
2- secrets.json
2+ secrets.js
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "description" : " " ,
55 "main" : " index.js" ,
6+ "type" : " module" ,
67 "scripts" : {
78 "dev" : " nodemon server.js"
89 },
Original file line number Diff line number Diff line change 1- {
1+ export default {
22 "mongoConnection": "",
3- "test" : " "
43}
Original file line number Diff line number Diff line change 1- const express = require ( 'express' ) ;
2- const bodyParser = require ( 'body-parser' )
1+ import express from 'express' ;
2+ import bodyParser from 'body-parser' ;
33const app = express ( ) ;
4- const ObjectID = require ( 'mongodb' ) . ObjectID ;
5- const MongoClient = require ( ' mongodb' ) . MongoClient
6- const config = require ( './secrets.json' ) ;
4+ import { default as mongodb } from 'mongodb' ;
5+ const MongoClient = mongodb . MongoClient ;
6+ import config from './secrets.js' ;
77
88async function getMongoCollection ( ) {
99 const client = new MongoClient ( config . mongoConnection ) ;
You can’t perform that action at this time.
0 commit comments