mirror of https://git.tuxpa.in/a/code-server.git
refactor: correct type signature in app.ts
This commit is contained in:
parent
850c7e1a91
commit
646ee3ad7f
|
@ -24,7 +24,7 @@ export const createApp = async (args: DefaultedArgs): Promise<[Express, Express,
|
||||||
: http.createServer(app)
|
: http.createServer(app)
|
||||||
|
|
||||||
let resolved = false
|
let resolved = false
|
||||||
await new Promise<http.Server>(async (resolve2, reject) => {
|
await new Promise<void>(async (resolve2, reject) => {
|
||||||
const resolve = () => {
|
const resolve = () => {
|
||||||
resolved = true
|
resolved = true
|
||||||
resolve2()
|
resolve2()
|
||||||
|
@ -46,10 +46,10 @@ export const createApp = async (args: DefaultedArgs): Promise<[Express, Express,
|
||||||
logger.error(error.message)
|
logger.error(error.message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server.listen(args.socket, () => resolve(server))
|
server.listen(args.socket, resolve)
|
||||||
} else {
|
} else {
|
||||||
// [] is the correct format when using :: but Node errors with them.
|
// [] is the correct format when using :: but Node errors with them.
|
||||||
server.listen(args.port, args.host.replace(/^\[|\]$/g, ""), () => resolve(server))
|
server.listen(args.port, args.host.replace(/^\[|\]$/g, ""), resolve)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue