/crowdhouse

A test assignment for crowdhouse

Primary LanguageJavaScriptMIT LicenseMIT

Pre-requisites

  • Node.js v8+
  • PostgreSQL server
    • listening on the standard port on host 127.0.0.1
    • no password for the DB user postgres required
  • Redis server listening on the standard port on host 127.0.0.1

Setup

  • Create the dummy "salesforce" relational database with ./bin/salesforce
    • the database schema will be created
    • the table investors will be pre-filled with some test data
  • Create the dummy "unified" database with ./bin/unidb
  • Start the application HTTP server with ./index 1337

API

$ curl -s -H 'Content-Type: application/json' -X PUT -d '{"password":"woo"}' http://localhost:1337/users/202
…
$ curl -s http://localhost:1337/users/202

The first HTTP request above changes the password for user 202. The second request fetches the user record from the both databases, and picks the most recent password update timestamp from the two.