master
yutent 2024-12-18 11:54:39 +08:00
parent 977e710fee
commit a14bdd8e41
1 changed files with 4 additions and 1 deletions

View File

@ -154,8 +154,11 @@ class Five {
// 启动http服务 // 启动http服务
listen(port = 3000, callback = noop) { listen(port = 3000, callback = noop) {
this.set({ port }) if (this.#online) {
return console.error('Server already started')
}
this.set({ port })
this.#online = true this.#online = true
this.#server = http.createServer() this.#server = http.createServer()