From 99df79824a5f47d212fb5183c53a11d73509b2bf Mon Sep 17 00:00:00 2001
From: 65160381 <65160381@go.buu.ac.th>
Date: Tue, 25 Mar 2025 00:46:13 +0700
Subject: [PATCH] 6

---
 app.js                               | 4 ++--
 views/index.ejs => public/index.html | 0
 2 files changed, 2 insertions(+), 2 deletions(-)
 rename views/index.ejs => public/index.html (100%)

diff --git a/app.js b/app.js
index 2b6a64e..f8bac85 100644
--- a/app.js
+++ b/app.js
@@ -51,9 +51,9 @@ pool.getConnection()
 // ตัวอย่าง route ทดสอบ
 app.get('/', (req, res) => {
     if (req.session.user) {
-        res.sendFile(path.join(__dirname, 'public', 'index.ejs'));
+        res.sendFile(path.join(__dirname, 'public', 'index.html'));
     } else {
-        
+        res.redirect('/login');
     }
 });
 
diff --git a/views/index.ejs b/public/index.html
similarity index 100%
rename from views/index.ejs
rename to public/index.html
-- 
GitLab