Skip to content

Commit

Permalink
Create test.js
Browse files Browse the repository at this point in the history
  • Loading branch information
CYHFREDA authored Oct 15, 2024
1 parent a3bd025 commit 50f86f6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions backend/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const http = require('http');

// 測試是否能啟動服務
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Server is running!');
});

server.listen(5001, () => {
console.log('測試伺服器在連接埠 5001 上運行');
});

// 假設您有一個正常執行的代碼功能
setTimeout(() => {
console.log('程式碼運行順利!');
process.exit(0); // 正常退出
}, 1000); // 延遲1秒以確認服務已啟動

0 comments on commit 50f86f6

Please sign in to comment.