Add authenticate
- Create new controller authenticate with login root.. - Update and manage error message socket io. - Create enum for environment variables
This commit is contained in:
parent
e8da727cae
commit
53e1600e67
8 changed files with 85 additions and 7 deletions
|
@ -4,6 +4,9 @@ export class Message {
|
|||
|
||||
constructor(message: string) {
|
||||
let data = JSON.parse(message);
|
||||
if(!data.userId || !data.roomId){
|
||||
throw Error("userId and roomId cannot be null");
|
||||
}
|
||||
this.userId = data.userId;
|
||||
this.roomId = data.roomId;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@ export class Point implements PointInterface{
|
|||
y: number;
|
||||
|
||||
constructor(x : number, y : number) {
|
||||
if(!x || !y){
|
||||
throw Error("x and y cannot be null");
|
||||
}
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue