Problem
Today we are able to inject any kind of server library (restfy, express, koa) inside newServer function, but the code was developed using only express interface
What you need to do
Im open to discussions about this, but basically, we need to create an adapter layer to change theattachController` logic once that we pass a different kind of library to do the server.
My opinion: I think in create submodules as: restoose-express, restoose-koa .... and make something like:
const express = require('restoose-express') // this will contain logic to init the app and mapping the controller
Problem Today we are able to inject any kind of server library (restfy, express, koa) inside
newServer
function, but the code was developed using only express interfaceWhat you need to do I
m open to discussions about this, but basically, we need to create an adapter layer to change the
attachController` logic once that we pass a different kind of library to do the server.My opinion: I think in create submodules as:
restoose-express
,restoose-koa
.... and make something like:References: https://github.com/guidiego/restoose/blob/master/example/express/index.js#L6 https://github.com/guidiego/restoose/blob/master/restoose/utils/attachControllers/index.js