I am building an application in loopback and wondering how to build a service layer with an API which is not related to any model. Here is my scenario.
I have a two models User, Game, UserGames. UserGames is a many-to-many relation and stores the score of users in different games. I want to provide an API for weeklyLeaderboard but I don't want it to be a Remote Method for any of the my models as it doesn't fit the RESTful API guidelines.
The only way I can find to implement right now is to create a service common/service/weeklyLeaderboard.js and a route in server/boot/routes.js which accesses this service. In that case, I would have to re-arrange the middlewares in my middleware.json to have non remote-method end-points treated in the same way as remote methods and have access to the currentContext.
Is there a better way to implement APIs which are not related to a specific model but access several data-access and business objects.