2020-01-21 18:25:35 +01:00
fix
2020-01-21 18:25:35 +01:00
2019-09-02 08:22:57 +02:00
2019-09-03 12:24:50 +02:00
2019-09-03 12:24:50 +02:00
2020-01-21 16:14:53 +01:00
2019-07-04 12:21:37 +02:00
2019-10-21 10:16:32 +02:00
2019-10-21 10:16:32 +02:00
2019-10-21 11:08:56 +02:00

AppReports

Collects error reports from http capable apps over http-post requests. Reports are stored in a postgresql database and can be viewed by accessing the server using a browser.

Installation

Setting up the server

git clone https://git.scode.ovh/timo/appreports
cd appreports
npm i

Setting up the database

run the following sql script:

-- create user and database
create database appreports;
create user appreports with encrypted password '12345';
grant all privileges on database appreports to appreports;

Configuration

  • make a copy of the template:

cp config.template.json config.json

  • edit the config.json to your preferences

Usage

Starting the server

run the following command in the server folder

nodejs index.js

Sending an error report

Example in js:

const appClientId = 'abcdefg';

window.onerror = async function(msg, source, lineno, colno, error) {
  let data;
  if (error) {
    data = {
      app: 'app1',
      type: 'error',
      client: appClientId,
      message: msg,
      stack: error.stack,
      misc: `v: ${appVersion} src: ${source} ln: ${lineno} col: ${colno}`
    };
  } else {
    data = { app: 'app1', type: 'error', client: appClientId, message: msg };
  }
  fetch('http://localhost:8080', {
    method: 'POST',
    body: JSON.stringify(data),
    mode: 'no-cors'
  });
};

to view the reports open http://localhost:8080 with a browser (in case of the default config)

License

GNU General Public License v3.0 or later © Timo Hocker

Description
No description provided
Readme 536 KiB
Languages
JavaScript 85.4%
Vue 5.2%
SQL 4.1%
TSQL 3.6%
HTML 1.1%
Other 0.6%