import { Response, Request } from "express"; /** * Response to a request * * @author Pierre HUBERT */ export class RequestHandler { public constructor(private req : Request, private response : Response) {} /** * Output an error code * * @param code HTTP Status code * @param message The message to send */ public error(code : number, message : string) { this.response.status(code).send({ code: code, message: message }) } /** * Send some data to the server * * @param data The data to send back to the server */ public send(data: any) { this.response.send(data); } }