1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/backend/middlewares/BaseMWs.ts
2016-03-19 09:58:27 +01:00

16 lines
486 B
TypeScript

import {NextFunction, Request, Response} from "express";
import {Message} from "../../common/entities/Message";
import {Error} from "../../common/entities/Error";
export class BaseMWs {
protected static renderMessage<T>(res:Response, content:T){
let message = new Message<T> ([],content);
res.json(message);
}
protected static renderError(res:Response, error:Error){
let message = new Message<any> ([],null);
res.json(message);
}
}