Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seveibar/postgrest-node
Use postgrest (RESTful Postgres API) as an npm module and in serverless environments
https://github.com/seveibar/postgrest-node
Last synced: about 1 month ago
JSON representation
Use postgrest (RESTful Postgres API) as an npm module and in serverless environments
- Host: GitHub
- URL: https://github.com/seveibar/postgrest-node
- Owner: seveibar
- Created: 2020-09-18T21:36:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-11T03:13:41.000Z (about 3 years ago)
- Last Synced: 2024-04-25T01:42:17.908Z (8 months ago)
- Language: JavaScript
- Size: 233 KB
- Stars: 36
- Watchers: 4
- Forks: 9
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jimsghstars - seveibar/postgrest-node - Use postgrest (RESTful Postgres API) as an npm module and in serverless environments (JavaScript)
README
# postgrest-node
[![npm version](https://badge.fury.io/js/postgrest.svg)](https://badge.fury.io/js/postgrest)
> PostgREST serves a fully RESTful API from any existing PostgreSQL database. It provides a cleaner, more standards-compliant, faster API than you are likely to write from scratch. - [postgrest github](https://github.com/PostgREST/postgrest)
Use [postgrest](http://postgrest.org) ([github](https://github.com/PostgREST/postgrest)) as an npm module for tighter integration with node apps (e.g. test fixtures). Also enables postgrest usage in serverless environments.
## Usage
`npm install postgrest`
```javascript
const postgrest = require("postgrest")const server = postgrest.startServer({
dbUri: "postgres://postgrest@localhost:5432/postgres",
dbSchema: "public",
serverPort: 3000,
dbAnonRole: "postgres",
//...any other postgrest config option, decamelize is run on each key
})// you can also do this...
// postgrest.startServer("/path/to/postgrest.conf")// ...let stuff happen
server.stop()
```## Serverless Usage
[Here's how to run postgrest on a serverless platform like vercel.](https://github.com/seveibar/postgrest-vercel)