https://github.com/waichungwong/jw-postgres-admin
A basic PostgreSQL client middleware for node with express.
https://github.com/waichungwong/jw-postgres-admin
admin express postgresql
Last synced: over 1 year ago
JSON representation
A basic PostgreSQL client middleware for node with express.
- Host: GitHub
- URL: https://github.com/waichungwong/jw-postgres-admin
- Owner: WaiChungWong
- License: mit
- Created: 2019-02-13T09:59:10.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-13T10:09:50.000Z (over 7 years ago)
- Last Synced: 2025-03-12T17:03:57.258Z (over 1 year ago)
- Topics: admin, express, postgresql
- Language: JavaScript
- Size: 556 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jw-postgres-admin
A basic PostgreSQL client middleware for node with express.
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]
[npm-image]: http://img.shields.io/npm/v/jw-postgres-admin.svg
[npm-url]: http://npmjs.org/package/jw-postgres-admin
[travis-image]: https://img.shields.io/travis/WaiChungWong/jw-postgres-admin.svg
[travis-url]: https://travis-ci.org/WaiChungWong/jw-postgres-admin
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/jw-postgres-admin.svg
[download-url]: https://npmjs.org/package/jw-postgres-admin
## Install
[](https://nodei.co/npm/jw-postgres-admin)
## Methods
| Method | Parameters | Description |
| -------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `` | `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](https://node-postgres.com/features/connecting). |
## Usage
```javascript
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.