Skip to content

Commit

Permalink
chore: code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Nov 6, 2024
1 parent 99324ad commit fb4524e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fishkit/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export async function createServer(opts: ServerOpts) {
app.use(compression());

let wsProxy;
if (opts.hmr !== false) {
if (opts.hmr) {
// proxy ws to mako server
wsProxy = createProxyMiddleware({
target: `http://127.0.0.1:${hmrPort}`,
Expand Down Expand Up @@ -93,7 +93,7 @@ export async function createServer(opts: ServerOpts) {
console.log(`Server is running on ${protocol}//${host}:${_port}`);
});

if (opts?.hmr !== false) {
if (opts?.hmr) {
// prevent first websocket auto disconnected
server.on('upgrade', wsProxy!.upgrade);
}
Expand Down

0 comments on commit fb4524e

Please sign in to comment.