From 829293a858f735a65dc7d8330597a69a83ef7f6d Mon Sep 17 00:00:00 2001 From: Levironexe Date: Thu, 17 Oct 2024 17:50:06 +0700 Subject: [PATCH] Hosting backend server --- app/api/backend.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/backend.mjs b/app/api/backend.mjs index 20b0880..68db7e5 100644 --- a/app/api/backend.mjs +++ b/app/api/backend.mjs @@ -13,7 +13,7 @@ app.use(express.json()); // Parse JSON requests app.use(cors({ origin: '*' })); // Enable CORS for all origins // MongoDB connection -const mongoUrl = 'mongodb+srv://leviron:123456Bom@blockscan.gooou.mongodb.net/BlockScanDB?retryWrites=true&w=majority&appName=BlockScan'; +const mongoUrl = process.env.NEXT_PUBLIC_MONGODB; mongoose .connect(mongoUrl, { useNewUrlParser: true, useUnifiedTopology: true }) .then(() => console.log('Connected to MongoDB'))