Gitlab@Informatics

Skip to content
Snippets Groups Projects
Commit 093e267c authored by 65160024's avatar 65160024
Browse files

update connection

parent df6e81c0
Branches
No related tags found
No related merge requests found
...@@ -27,3 +27,12 @@ app.use(cors()); ...@@ -27,3 +27,12 @@ app.use(cors());
readdirSync("./routes").map((c) => app.use("/api", require("./routes/" + c))); readdirSync("./routes").map((c) => app.use("/api", require("./routes/" + c)));
app.listen(3000, () => console.log("server is running on port 3000")); app.listen(3000, () => console.log("server is running on port 3000"));
db.connect((err) => {
if (err) {
console.error("❌ ไม่สามารถเชื่อมต่อฐานข้อมูล:", err);
return;
}
console.log("✅ เชื่อมต่อฐานข้อมูลสำเร็จ!");
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment