65406f844e
- Create end point to permit the teleport notification. The map url will be /teleport/token_user - Create message teleport - Create receive feature in phaser to teleport TODO Teleport player on black room.
19 lines
675 B
TypeScript
19 lines
675 B
TypeScript
import {HttpRequest, HttpResponse} from "uWebSockets.js";
|
|
import {ADMIN_API_TOKEN} from "../Enum/EnvironmentVariable";
|
|
|
|
|
|
export class BaseController {
|
|
protected addCorsHeaders(res: HttpResponse): void {
|
|
res.writeHeader('access-control-allow-headers', 'Origin, X-Requested-With, Content-Type, Accept');
|
|
res.writeHeader('access-control-allow-methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
|
|
res.writeHeader('access-control-allow-origin', '*');
|
|
}
|
|
|
|
protected checkAdminToken(req: HttpRequest): void {
|
|
//TODO
|
|
/*if(req.getHeader('Authorization') !== ADMIN_API_TOKEN){
|
|
throw 'Error token api';
|
|
}*/
|
|
}
|
|
}
|