update
parent
977e710fee
commit
a14bdd8e41
5
index.js
5
index.js
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue