tachybase_todo/packages/plugin-ui-router/src/server.ts
2021-07-12 22:13:48 +08:00

17 lines
506 B
TypeScript

import path from 'path';
import { Application } from '@nocobase/server';
import { registerModels } from '@nocobase/database';
import * as models from './models';
import getAccessible from './actions/getAccessible';
export default async function (this: Application, options = {}) {
const database = this.database;
registerModels(models);
database.import({
directory: path.resolve(__dirname, 'collections'),
});
this.resourcer.registerActionHandler('routes:getAccessible', getAccessible);
}