Skip to content

Commit b1c782f

Browse files
committed
Connect to process.env.MONGO_URL in production
1 parent 85f5964 commit b1c782f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { MongoClient } from 'mongodb'
22

33
export let db
44

5-
const URL = 'mongodb://localhost:27017/guide'
5+
const URL = process.env.MONGO_URL || 'mongodb://localhost:27017/guide'
66

77
export const connectToDB = async () => {
88
const client = new MongoClient(URL, { useNewUrlParser: true })

0 commit comments

Comments
 (0)