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()