You just saw how to create a very simple RESTful API with Hapi and Couchbase Server. ![]() The data will also be returned in the response. ![]() If our validation passes, we can insert the data into Couchbase with a unique id. If they do not exist, a default value will be used. ![]() If they exist, and error will be returned. It is forbidden for a type and timestamp property to exist in the request body. In this case both firstname and lastname need to be present. In this validation process we inspect the payload and make sure each of our properties meet the criteria. When a client tries to consume from this endpoint, validation happens as part of Hapi.
0 Comments
Leave a Reply. |