Skip to content

Commit

Permalink
refactor time
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Oct 7, 2023
1 parent 65dd7ee commit 55b1399
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ Bun.serve<{key: string}>({
}
if ( method === "time" ) {
logger.info('time', {key: ws.data.key, remoteAddress: ws.remoteAddress});
ws.send(JSON.stringify({id, status: 200, result: {serverTime: Number(Date.now())}}));
const serverTime = Number(Date.now());
ws.send(JSON.stringify({id, status: 200, result: {serverTime}}));
return;
}

Expand Down

0 comments on commit 55b1399

Please sign in to comment.