1.0.0 • Published 8 years ago

exception-html-template v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

Exception Html Template

Used for generating a more user friendly as well as readable HTML template for exception.

This plugin is used as part of my exception handling for email logger module

How to use

$ npm install exception-html-template --save-dev
import {getExceptionTplPromise} from 'exception-html-template';
//javascript es6
app.use('*', (err, req, res, next)=> {
    getExceptionTplPromise(err, res.statusCode).then((htmlTpl)=> {
        res.send(htmlTpl);
    });
});

//typescript
app.use('*', (err: any, req: Request, res: Response, next: NextFunction)=> {
    getExceptionTplPromise(err, res.statusCode).then((htmlTpl: string)=> {
        res.send(htmlTpl);
    }, ()=> {
        console.log('err');
    });
});

ScreenShot

alt tag

LICENSE

MIT