Closed jhusain closed 9 years ago
I think modelRoute name is incorrect, since it takes a Data Source generator function.
Probably a better name would be something to do with service, or with data source exposure to web
exposeDatasource
?
Ultimately the authentication part is contained in falcor-express making a middleware too (even tho not a pure one), for this reason i stand by exposeXXXXX being the correct wording (but then again i'm not even native english speaker)
We ended up using only data source route.
Currently we use the term "middleware" which i think is inappropriate. Usually middleware is code that executes before the code that finally emits the response. Middleware tends to handle transparent portions of the pipelined like authentication for example. The handler that we provide for serving model data is responsible for serving the actual response. We should rename expressMiddleware to "modelRoute".
var falcorExpress = require("falcor-express"); app.use("/model.json", falcorExpress.modelRoute((req, res)=> new Model(...));
cc @dzannotti for falcor-hapi