Open
Description
openedon Oct 16, 2020
Blocks #27156 and #69506
HttpRespurces plugin supports the GET
method only. I can see a couple of options here:
- add explicit method declaration (as it is in router)
httpResources.get({
path: '/login',
validate: {
params: schema.object({ id: schema.string() }),
},
},
async (context, request, response) => {
//..
return response.renderCoreApp();
});
- expose
render
API via contract
// http route handler
async (context, request, response) => {
const body = coreStart.httpResources.asScoped(request).renderHtml(..);
return response.ok({ body } );
});
It would allow us to support cases when a plugin renders an HTML page outside of the request context:
kibana/x-pack/plugins/security/server/authorization/authorization_service.tsx
Lines 168 to 198 in e31ec7e
That's why I'm inclining towards this option.
@elastic/kibana-platform WDYT?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment