From a14bdd8e419a27186b42a0a57d54a52a2347e651 Mon Sep 17 00:00:00 2001 From: yutent Date: Wed, 18 Dec 2024 11:54:39 +0800 Subject: [PATCH] update --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cf26378..879140b 100644 --- a/index.js +++ b/index.js @@ -154,8 +154,11 @@ class Five { // 启动http服务 listen(port = 3000, callback = noop) { - this.set({ port }) + if (this.#online) { + return console.error('Server already started') + } + this.set({ port }) this.#online = true this.#server = http.createServer()