nocobase2/examples/index.ts
chenos 28b73d7143
feat: add examples (#718)
* feat: add examples

* fix: tsconfig-paths/register

* feat: more examples

* fix: test errors

* feat: update examples

* docs: example list

* fix: updates

* feat: example for test case

* feat: api client

* fix: updates

* feat: tree structures

* fix: adjacency-list
2022-08-16 14:41:29 +08:00

15 lines
345 B
TypeScript

import Database from '@nocobase/database';
import Application from '@nocobase/server';
const argv = process.argv;
const path = argv.splice(2, 1).shift();
const app = require(`./${path}`).default;
if (app instanceof Application) {
app.runAsCLI(argv);
}
if (app instanceof Database) {
console.log('Table prefix: ', app.getTablePrefix());
}