0405443391230f56ba25db55758e5dd28eb6b8c7
				
			
			
		
	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 = {
      message: msg,
      stack: error.stack,
      misc: `v: ${appVersion} src: ${source} ln: ${lineno} col: ${colno}`
    };
  } else {
    data = { message: msg };
  }
  /*
   * the first 4 characters of the client will be displayed as app
   * the remaining characters (up to 64) will be displayed as client
   */
  fetch('http://localhost:8080?client=app1' + appClientId, {
    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
Description
				
					Languages
				
				
								
								
									JavaScript
								
								85.4%
							
						
							
								
								
									Vue
								
								5.2%
							
						
							
								
								
									SQL
								
								4.1%
							
						
							
								
								
									TSQL
								
								3.6%
							
						
							
								
								
									HTML
								
								1.1%
							
						
							
								
								
									Other
								
								0.6%