File tree 4 files changed +8
-8
lines changed
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
1
package-lock.json
2
- secrets.json
2
+ secrets.js
Original file line number Diff line number Diff line change 3
3
"version" : " 1.0.0" ,
4
4
"description" : " " ,
5
5
"main" : " index.js" ,
6
+ "type" : " module" ,
6
7
"scripts" : {
7
8
"dev" : " nodemon server.js"
8
9
},
Original file line number Diff line number Diff line change 1
- {
1
+ export default {
2
2
"mongoConnection": "",
3
- "test" : " "
4
3
}
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' ;
3
3
const 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' ;
7
7
8
8
async function getMongoCollection ( ) {
9
9
const client = new MongoClient ( config . mongoConnection ) ;
You can’t perform that action at this time.
0 commit comments