![]() ![]() ![]() However, both will get the job done and if you’d like to see an Express alternative, check out this previous tutorial I wrote.įor more information on using Couchbase with Node.js, check out the Couchbase Developer Portal. I’ve been using Express since the beginning, but when it comes to Hapi, I feel like it was much better designed for creating web services. You just saw how to create a very simple RESTful API with Hapi and Couchbase Server. Azure, AWS etc) or on your local machine. The data will also be returned in the response. To follow the steps in this tutorial youll need the following: Node.js & npm - includes the Node.js runtime, command line tools and package manager, install it from MySQL - youll need access to running MySQL server instance for the API to connect to, it can be remote (e.g. 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. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |