diff --git a/index.html b/index.html
new file mode 100644
index 0000000..a420124
--- /dev/null
+++ b/index.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+ Document
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pm2.config.cjs b/pm2.config.cjs
index bfb80dd..8d7d9ab 100644
--- a/pm2.config.cjs
+++ b/pm2.config.cjs
@@ -11,9 +11,7 @@ module.exports = {
env: {
"NODE_ENV": "production",
"PORT": 80,
- "DATABASE_URL": "localhost:27017",
- "DATABASE_USER": "labplus_admin",
- "DATABASE_PASSWORD": "******",
+ "DATABASE_URI": "mongodb://USERNAME:PASSWORD@localhost:27017",
}
}]
}
\ No newline at end of file
diff --git a/src/index.js b/src/index.js
index 31e2285..cad62a2 100644
--- a/src/index.js
+++ b/src/index.js
@@ -8,16 +8,9 @@ dotenv.config()
const app = Express()
const PORT = process.env.PORT || 8080
-// Database Connect String
-const DB_URL = process.env.DATABASE_URL
-const DB_USERNAME = process.env.DATABASE_USERNAME
-const DB_PASSWORD = process.env.DATABASE_PASSWORD
-const DB_NAME = "labplus"
-
-const DATABASE_URI = `mongodb://${DB_USERNAME}:${DB_PASSWORD}@${DB_URL}/${DB_NAME}`
-
-mongoose.connect(DATABASE_URI)
+mongoose.connect(process.env.DATABASE_URI)
const db = mongoose.connection
+
db.on("error", (error) => console.error(error))
db.once("open", () => console.log("Connected to Database"))