Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MadDogTechnology/postrestql
Create RESTful web services from a PostgreSQL database
https://github.com/MadDogTechnology/postrestql
Last synced: 4 months ago
JSON representation
Create RESTful web services from a PostgreSQL database
- Host: GitHub
- URL: https://github.com/MadDogTechnology/postrestql
- Owner: MadDogTechnology
- Archived: true
- Created: 2017-04-21T20:14:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-03T17:53:22.000Z (about 6 years ago)
- Last Synced: 2024-04-26T23:03:13.084Z (8 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# postrestql
**Owner(s):**# Repo is archived
PostRESTql
==========PostRESTql is a node server that automatically creates RESTful web services from a connected PostgreSQL database. If also provides a simple way to quickly create custom web services using more complex queries.
## Installation
npm install postrestql
## Basic Use
The simplest setup looks like this:
var postrestql = require("postrestql");
var config = {
"db_connections": {
"admin": "postgres://username:password@server:5432/catalog"
}
};postrestql.start(config);
If the `admin` connection string points to a user on a running PostgreSQL server with sufficient privileges, a web service will be created on port :4100 that will list all tables as HTML pages.
## Configuration Reference
var config = {
"db_connections": {
"admin": "postgres://chrisbroski:@localhost:5432/utilities",
"web_user": "postgres://chrisbroski:@localhost:5432/utilities"
},
"port": 4100,
"cors": true,
"sql_folder": "./sql"
"custom": [
{
"name": "totals by month",
"path": "/month-totals/{{integer}}/{{integer}}",
"sql_statement": "get_month_totals"
},
{
"name": "totals by month",
"path": "/month-totals/{{integer}}/{{integer}}",
"sql": "get_month_totals",
"default": [2017, 1]
}
]
};