Sign inSign up

stevenalexander/node-people-api

By stevenalexander

Updated over 8 years ago

Simple Express RESTful API for People data designed for use in CI/orchestration PoCs

Image
0

643

stevenalexander/node-people-api repository overview

Node People API

BuildStatus JavaScript Style Guide

Simple Express RESTful API for People data.

Using as part of testing various build/containerisation PoCs.

Requires

Run

npm install

# Start PostGres container
# docker run --name some-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres

# Setup DB
npm run migrations

# available http://localhost:3001/people
npm start
Run in container
# Spin up PostGres and node-people-api containers
docker-compose up

Test

npm test

API Documentation

The API is documented using API Blueprint at PeopleApi.apib and a friendly static HTML version is generated using aglio which is available on at URL /documentation.html.

The documentation is be updated for changes by:

npm install -g aglio
aglio -i PeopleApi.apib --theme-template triple -o app/documentation/documentation.html

The PeopleApi.apib file can be used by various tools to aid with testing or generating clients.

Notes

  • used npm shrinkwrap to fix dependency versions
  • added wait-for-postgres.sh script to poll container using knex migrate:currentVersion before running migration scripts, avoiding the need to call migration scripts outside container

Tag summary

Content type

Image

Digest

Size

27.4 MB

Last updated

over 8 years ago

docker pull stevenalexander/node-people-api