Skip to content

Latest commit

 

History

History
73 lines (54 loc) · 1.58 KB

postgresql-storage.md

File metadata and controls

73 lines (54 loc) · 1.58 KB

Errsole with PostgreSQL

Install

Install the errsole and errsole-postgres modules using the npm install command:

npm install errsole errsole-postgres

Configure

// CommonJS
const errsole = require('errsole');
const ErrsolePostgres = require('errsole-postgres');
// ESM and TypeScript
import errsole from 'errsole';
import ErrsolePostgres from 'errsole-postgres';
// Insert the Errsole code snippet at the beginning of your app's main file
errsole.initialize({
  storage: new ErrsolePostgres({
    host: 'postgres-host', // Replace with your actual PostgreSQL host
    user: 'database-user', // Replace with your actual PostgreSQL user
    password: 'database-password', // Replace with your actual PostgreSQL password
    database: 'database-name' // Replace with the name of your PostgreSQL database
  })
});

Example

const express = require('express');
const errsole = require('errsole');
const ErrsolePostgres = require('errsole-postgres');

// Insert the Errsole code snippet at the beginning of your app's main file
errsole.initialize({
  storage: new ErrsolePostgres({
    host: 'localhost',
    user: 'root',
    password: 'password',
    database: 'dbname'
  })
});

const app = express();

app.get('/', function (req, res) {
  res.send('Hello World');
});

app.listen(3000);

Advanced Configuration

Advanced Configuration

Web Dashboard Access

Web Dashboard Access

Main Documentation

Main Documentation