Create backend

- NodeJs
 - Express
 - Socket.io
 - Eslint
 - TypeScript
This commit is contained in:
gparant 2020-04-04 04:08:12 +02:00
parent c0e75ae07e
commit ba335aa33d
10 changed files with 2277 additions and 0 deletions

View file

@ -0,0 +1,23 @@
export class JoinRoomMessage {
userId: string;
roomId: string;
positionXUser: string;
positionYUser: string;
constructor(message: string) {
let data = JSON.parse(message);
this.userId = data.userId;
this.roomId = data.roomId;
this.positionXUser = data.positionXUser;
this.positionYUser = data.positionYUser;
}
toString(){
return JSON.stringify({
userId: this.userId,
roomId: this.roomId,
positionXUser: this.positionXUser,
positionYUser: this.positionYUser
})
}
}