-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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秒以確認服務已啟動 |