Super simple, super small, super duper.
- You have a rethink database running locally
- You have an
invitations
table in that database - You have a secondary index for
hash
on that table
yarn install && yarn start
Creating invitations
POST /create -d '{"email":"[email protected]"}'
❯ 201, {
hash: 'ef32e540-472d-11e7-a574-43adb376c9f6',
status: 'pending',
email: '[email protected]'
}
Redeeming invitations
GET /:hash
❯ 200, {
hash: 'ef32e540-472d-11e7-a574-43adb376c9f6',
status: 'redeemed',
email: '[email protected]'
}
❯ 404, 'Invitation not found'
❯ 409, 'Invitation already redeemed'
Asserting invitations
HEAD /:hash
❯ 200
❯ 404