UNPKG

@meisens1/lotr-sdk

Version:
7 lines (4 loc) 1.03 kB
I decided that my quickest approach to this would be to create routes and controllers for the various endpoints. Additionally, I created models for quotes and movie objects so that shipping them around would be easier and clear. I decided that it would easy to create a client which utilized my controller methods for both movie endpoints and quote endpoints. This architecture makes available both a SDK client (client.js and the client-test.js to test it) OR the Web API solution via expressJS (index.js) I am keeping the baseUrl and the accessToken in the config.js for use with the Web API option. In keeping needs separate I decided to break up the controllers into movieController and quoteController, further development makes this easy to add new controllers for other aspects/models of the API. Pagination has been included for all calls that return more than 1 item at a time via page and limit (# of items per page, sometimes this is noted as 'size') All in all this is super light weight, easy to use and extend.