mirror of
https://github.com/coder/code-server.git
synced 2025-07-31 05:54:15 +08:00
Move websocket routes into a separate app
This is mostly so we don't have to do any wacky patching but it also makes it so we don't have to keep checking if the request is a web socket request every time we add middleware.
This commit is contained in:
@ -102,9 +102,9 @@ const main = async (args: DefaultedArgs): Promise<void> => {
|
||||
throw new Error("Please pass in a password via the config file or $PASSWORD")
|
||||
}
|
||||
|
||||
const [app, server] = await createApp(args)
|
||||
const [app, wsApp, server] = await createApp(args)
|
||||
const serverAddress = ensureAddress(server)
|
||||
await register(app, server, args)
|
||||
await register(app, wsApp, server, args)
|
||||
|
||||
logger.info(`Using config file ${humanPath(args.config)}`)
|
||||
logger.info(`HTTP server listening on ${serverAddress} ${args.link ? "(randomized by --link)" : ""}`)
|
||||
|
Reference in New Issue
Block a user