Skip to content

Conversation

@Privatech38
Copy link
Member

No description provided.

@MaticBabnik
Copy link
Member

Live and possibly alive @ https://pr-2.dev.sync.si/api/

@MaticBabnik
Copy link
Member

this is ready for review?

@Privatech38
Copy link
Member Author

this is ready for review?

@MaticBabnik yes, this is more or less the foundation we will work around

@Privatech38 Privatech38 self-assigned this Jan 6, 2026
@Privatech38 Privatech38 linked an issue Jan 6, 2026 that may be closed by this pull request

This comment was marked as spam.

clientID: ClientID;
}

export const HANDLER_REGISTRY: Record<string, (ws: Bun.ServerWebSocket<WebSocketData>, message: any) => void> = {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would prefer that the REGISTRY would be constructed in one file (registry file imports all functions) rather than each handler registering itself in it's own file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is event/clientJoin a thing? This should probably run on open

* Returns a shallow clone of all rooms
*/
export function allRooms(): Map<string, Room> {
return new Map<string, Room>(rooms)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again not a fan of shallow clones.

If we really care about the map not being mutable we can just provide getRoom(x:string): Room and getRooms(): Iterator<Room> (maybe its Iterable not sure)

const app = new Elysia()
.get("/randomNumber", () => ({ result: ~~(Math.random() * 10000) }))
.get('/health', () => 'OK')
const statusler = "healthy";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who let @KickTheApple cook?

.get("/randomNumber", () => ({ result: ~~(Math.random() * 10000) }))
.get('/health', () => 'OK')
const statusler = "healthy";
let uptimeler = Date.now();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Who let @KickTheApple cook pt2?

uptime: Math.floor((Date.now() - uptimeler) / 1000)
}
})
.listen(3000);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two servers?

@MaticBabnik MaticBabnik self-assigned this Jan 8, 2026
@MaticBabnik MaticBabnik linked an issue Jan 8, 2026 that may be closed by this pull request
@MaticBabnik MaticBabnik merged commit c645cf6 into main Jan 8, 2026
5 checks passed
@MaticBabnik MaticBabnik deleted the backend/main branch January 10, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add API endpoints to backend Add Websocket to backend

3 participants