Initial commit

This commit is contained in:
kevisual
2025-03-07 22:46:59 +08:00
commit 479eaccf57
14 changed files with 4701 additions and 0 deletions

8
src/app.ts Normal file
View File

@@ -0,0 +1,8 @@
import { App } from '@kevisual/router';
import { useContextKey } from '@kevisual/use-config/context';
const init = () => {
return new App();
};
export const app = useContextKey('app', init);

16
src/demo-route.ts Normal file
View File

@@ -0,0 +1,16 @@
import { app } from './app.ts';
import { useConfig } from '@kevisual/use-config';
app
.route({
path: 'demo',
key: 'demo',
})
.define(async (ctx) => {
ctx.body = '123';
})
.addTo(app);
const config = useConfig();
console.log('run demo: http://localhost:' + config.port + '/api/router?path=demo&key=demo');

8
src/dev.ts Normal file
View File

@@ -0,0 +1,8 @@
import { useConfig } from '@kevisual/use-config';
import { app } from './index.ts';
const config = useConfig();
app.listen(config.port, () => {
console.log(`server is running at http://localhost:${config.port}`);
});

4
src/index.ts Normal file
View File

@@ -0,0 +1,4 @@
import { app } from './app.ts';
import './demo-route.ts';
export { app };

9
src/modules/mark.ts Normal file
View File

@@ -0,0 +1,9 @@
import { Mark, markModelInit } from '@kevisual/mark';
export { Mark, markModelInit };
export const init = () => {
markModelInit({
tableName: '',
});
};

1
src/modules/sequelize.ts Normal file
View File

@@ -0,0 +1 @@
export { sequelize } from '@kevisual/code-center-module';

9
src/modules/user.ts Normal file
View File

@@ -0,0 +1,9 @@
import { sequelize, User, UserInit, Org, OrgInit } from '@kevisual/code-center-module';
export { sequelize, User, UserInit, Org, OrgInit };
export const init = () => {
UserInit();
OrgInit();
};
init();