Most modern applications are real time, not in the traditional sense, but in the sense that they don't need the page to reload for them to be updated. The most common way to implement this is through WebSockets. In this recipe, we will leverage Feathers and Socket.io to build a cat database.
There is no prerequisite for this recipe, but you can complete the Createing a REST client (and server!) recipe before starting this one if you want to have more context.
To complete this recipe, you'll need the Feathers' command line; install it with the following command:
npm install -g feathers-cli
Now, run feathers generate
, which will create all the boilerplate for you. When asked about the API, select Socket.io
:
All the other questions can be left to the default value. While still in the Feather console, type generate service
to create a new service. You can call it cats and leave the other questions to their default values.
Inside the...