0.1.0 • Published 5 years ago

jw-postgres-admin v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

jw-postgres-admin

A basic PostgreSQL client middleware for node with express.

NPM version build status node version npm download

Install

NPM

Methods

MethodParametersDescription
<main>presetCredentials (optional) : { host:string port:string user:string password:string }the preset connection information which will be passed into client as configuration programmatically when connecting to a PostgreSQL database. See connecting with node-postgres.

Usage

import express from "express";
import postgresAdmin from "jw-postgres-admin";

const app = express();
const port = process.env.PORT || 3000;

app.use("/postgres-admin", postgresAdmin());

app.listen(port);

Using postgres admin client

The react client is located on whatever path the middleware is set. For example from above - it is located at http://localhost:3000/postgres-admin. It uses the database connection information as an authentication, and will prompt for any required information which is not provided in the preset credentials until a successful connection is made.