added express packer

This commit is contained in:
Dolan Miu
2016-03-31 19:28:12 +01:00
parent 8303fb16ea
commit 4b90e1800b
2 changed files with 27 additions and 3 deletions

View File

@ -0,0 +1,21 @@
import {Packer} from "./packer";
import * as fs from "fs";
import * as express from "express";
export class ExpressPacker extends Packer {
private res: express.Response;
constructor(res: express.Response) {
super();
this.res = res;
this.res.on('close', () => {
return res.status(200).send('OK').end();
});
}
pack() {
this.res.attachment(name + ".docx");
super.pack(this.res);
}
}