import { PluginInstance, PluginContext } from '../../backend/src/core/types';
import { createRoutes } from './backend/routes';
import manifest from './manifest.json';

const plugin: PluginInstance = {
    manifest: manifest as any,
    async activate(ctx: PluginContext): Promise<void> {
        ctx.logger.info('Registering Nanobana routes...');

        ctx.app.use(manifest.backend.routePrefix, createRoutes(ctx));

        ctx.logger.info('Nanobana activated!');
    },
    async deactivate(ctx: PluginContext): Promise<void> {
        ctx.logger.info('Nanobana deactivated');
    },
};

export default plugin;
