Skip to content

Commit

Permalink
handle /
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary0901 committed Oct 14, 2024
1 parent e8ea578 commit 763df48
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dotenv": "^16.4.5",
"express": "^4.21.0",
"lodash": "^4.17.21",
"mongodb": "^6.9.0",
"mongoose": "^8.7.0",
"uuid": "^10.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,6 @@ document.getElementById('identifyButton').addEventListener('click', identifyUser
mongoDB Atlas
username: gary50132
Password : NvHvn8TGSroRRC9o
mongodb+srv://gary50132:<db_password>@cluster0-forknn-method.g2inm.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0-forKNN-method
*/
3 changes: 3 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ connectDB(); // 連接到MongoDB 資料庫。
app.use(express.json()); // 允許服務器解釋JSON格式的請求體。
app.use(express.static('public')); // 設置靜態文件服務,使public文件夾中的文件可以直接被訪問。

app.get('/',(req,res)=>{
res.sendFile(path.join(__dirname,'public','index.html'))
})

app.post('/login', async (req, res) => {
try {
Expand Down

0 comments on commit 763df48

Please sign in to comment.