drew28 / express-crud-pg-promise

Just a basic Node + Express CRUD app with pg-promise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Express CRUD with pg-promise

Just a basic Node + Express CRUD app with pg-promise

Getting Started

  1. Fork/Clone
  2. Install Dependencies
  3. Fire up the Postgres server
  4. Run psql -f src/server/db/beers.sql to set up the database, create a table, and seed the table
  5. gulp

Sample Requests

With HTTPie:

$ http GET http://localhost:3000/api/v1/beers
$ http GET http://localhost:3000/api/v1/beers/1
$ http POST http://localhost:3000/api/v1/beers name=concentration abv=9 brand="russian river" style="sour porter"
$ http PUT http://localhost:3000/api/v1/beers/2 field=abv value=222
$ http DELETE http://localhost:3000/api/v1/beers/1

Versions

  1. Method 1
  • Pro: Easy to set up and understand
  • Con: Hard to test and scale
  1. Method 2
  • Pro: Easier to test and scale
  • Con: Harder to set up and understand
  1. Method 3
  • Pro: Easiest to test and scale
  • Con: Hardest to set up and understand

About

Just a basic Node + Express CRUD app with pg-promise


Languages

Language:JavaScript 87.2%Language:HTML 12.0%Language:CSS 0.8%