Skip to content

Commit

Permalink
onrequest
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjoar committed May 26, 2017
1 parent 0c77a8e commit 14d44cc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions platform/server/elasticsearch/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ export function createElasticsearchRoutes(routerFactory: RouterFactory, schema:
const router = routerFactory.createRouter('/plugin/elasticsearch');

router.get({
// TODO explore `onRequest` to create the "facade"s per request instead of
// globally, as most requests only rely on a single helper there's no point
// in injecting too many of them. This might also simplify testing as well,
// as we can test the facades without requiring `req` in every method.
//
// onRequest: (kibana, req) => new SavedObjectsFacade(...),
path: '/:field',
validate: {
params: schema.object({
Expand Down

0 comments on commit 14d44cc

Please sign in to comment.