/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License * and the Server Side Public License, v 1; you may not use this file except in * compliance with, at your election, the Elastic License or the Server Side * Public License, v 1. */ import { PluginInitializerContext, CoreSetup, CoreStart, Plugin, Logger, } from '../../../src/core/server'; import { StateDemoPluginSetup, StateDemoPluginStart } from './types'; import { defineRoutes } from './routes'; export class StateDemoServerPlugin implements Plugin { private readonly logger: Logger; constructor(initializerContext: PluginInitializerContext) { this.logger = initializerContext.logger.get(); } public setup(core: CoreSetup) { this.logger.debug('State_demo: Ssetup'); const router = core.http.createRouter(); // Register server side APIs defineRoutes(router); return {}; } public start(core: CoreStart) { this.logger.debug('State_demo: Started'); return {}; } public stop() {} } export { StateDemoServerPlugin as Plugin };