O'Reilly logo

Express.js Blueprints by Ben Augarten, Marc Kuo, Eric Lin, Aidha Shaikh, Fabiano Pereira Soriani, Geoffrey Tisserand, Chiqing Zhang, Kan Zhang

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Considering user history

Our users will probably want to always be paired to meet new people, so we have to avoid repetitive meetings. How should we handle this?

First, we need to allow for a method to set up new meetings. Think of it as a button in an app that would trigger a request to the route POST/meeting/new.

This endpoint will reply with the status 200 when the request is allowed and a pair is found, or if there is no pair but they are now attached to a meeting object and can now be matched with another user; 412 if the user is already scheduled in another meeting and 400 in case the expected e-mail of the user isn't sent; in this case, it can't be fulfilled because the user wasn't specified.

Tip

The usage of status codes is somewhat subjective, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required