Creating REST APIs has always been a challenging job. LoopBack, a highly extensible open source Node.js API framework, is meant to make that experience easy. IBM API Connect provides the tools to use with LoopBack projects. In this developer pattern, we’ll demonstrate the basic flows to create and expose REST APIs using LoopBack.
In this journey, we’ll build REST APIs for a service named AnimalsDemo. The service itself is fictional, but the steps are the same that you’d use for any real service. First, we create the APIs, which we then link to a data source. Second, we define the data models and set up access control. Finally, we push the app to IBM Cloud. These steps will remain the same even with an actual production-ready service. The beauty of LoopBack is it saves a lot of effort in coding redundant functionalities, since most REST APIs are about CRUD operations after all.
- User scaffolds API using LoopBack CLI.
- User links to Compose for MongoDB data source.
- User generates the model objects.
- User configures the ACL.
- User prepares the manifests for deployment.
- User pushes app to IBM Cloud® Cloud Foundry.