In this post, I will connect the generated API (see Part 1) to my local MongoDB database and correct some errors that I’ve done on my swagger definition. Fixing the swagger API definition In my V0.1 WordList definition, the id field was defined as a String : WordList: type: "object" properties: id: type: "string" title: "Word list ID" words: type: "array" title: "Words" items: $ref: "#/definitions/Word" This won’t work as the id field is expected to be an integer field.
The history In 2015, IBM as bought Strongloop, the company behind the loopback.io API framework. During the last months, I’ve been looking at all the framework and products that are available to build an API based solutions. Some framework/products are Opensource (ex: OpenAPI, restify and Feathers), others not (ex: Amazon API Gateway) and many are in between (ex: Apigee, Strongloop). As a developer, I see a big advantage in using an opensource framework and I don’t want a vendor lock-in during the lifespan of my solution.
Now that my design as been done with the swagger format, I’ll start the coding with LoopBack. Apigee-127 Before deciding to use loopback, my first attempt was with Apigee-127. The framework was easy to use until I realized that while the API Gateway is written using pure node.js code, the favorite choice of implementation is the apache usergrid BaaS Framework. Since apache usergrid is writting in Java EE stack and not a pure node.js implementation I have to eliminate it.
To build my first API, I will use a design first approach. Why design first ? My background as a software architect leads me naturally to opt for a design first approach. I googled a little bit to confirm that the design first approach still applies in an Agile and API world (we never know) : Excellent presentation from Jason Harmon or similar on slideshare API Evangelist apigee Use case The use case that will be used for the first API will be based on a flash word learning technic that is used for kids with dyslexia.
The start of my exploration on API’s. Why? The objective of the exercise is to better understand the different issues surrounding the implementation of modern solutions based on a deployable cloud API architecture. Platform selection Many platforms exist, see API Evangelist - August 2015 To limit the choice, I’ll select the platform based on some personal criteria : Available in open source on Github BaaS platform or compatible with a BaaS Fullstack Javascript Stable release Github - Release Finalists I retain the following platforms in my initial experimentation : apigee via a127 LoopBack sails restify My personal setup To build my first projet, I will use the Microsoft code editor on an Asus UX305C portable computer.