mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
This creates a response_stream plugin in the Kibana /examples section. The plugin demonstrates API endpoints that can stream data chunks with a single request with gzip/compression support. gzip-streams get decompressed natively by browsers. The plugin demonstrates two use cases to get started: Streaming a raw string as well as a more complex example that streams Redux-like actions to the client which update React state via useReducer().
15 lines
595 B
TypeScript
15 lines
595 B
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
* Side Public License, v 1.
|
|
*/
|
|
|
|
import { PluginInitializerContext } from '@kbn/core/server';
|
|
|
|
import { ResponseStreamPlugin } from './plugin';
|
|
|
|
export function plugin(initializerContext: PluginInitializerContext) {
|
|
return new ResponseStreamPlugin(initializerContext);
|
|
}
|