apipost-error-report
TypeScript icon, indicating that this package has built-in type declarations

1.1.8 • Public • Published

error-report

A component used to collect reported error logs

使用

  npm i apipost-error-report -S

文件入口使用:

webpack.config.js添加

{ resolve: { fallback: { crypto: false } } }


  import { Monitor } from 'apipost-error-report';

  const monitor = Monitor.init({
    report: {
      url: 'http://localhost:9898/reportError',      // 错误上报url
      method: 'post',                         
      contentType: 'application/x-www-form-urlencoded'
    }
  }, {
    appVersion: '1',  
    gitHash: 'githush'
  });

  错误监听
  monitor.on('event', (errorName, errorInfo) => {
    // 错误上报至后台
    monitor.reporter.reportError(errorInfo)
  })

Readme

Keywords

none

Package Sidebar

Install

npm i apipost-error-report

Weekly Downloads

1

Version

1.1.8

License

ISC

Unpacked Size

227 kB

Total Files

19

Last publish

Collaborators

  • danceli