diff --git a/app.js b/app.js index 2b6a64e5653ff78f242e8b0c7e86ac9210a0aa64..f8bac85f9e4790f19f606763946ca81374396166 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