generated from tailored/router-db-template
Initial commit
This commit is contained in:
8
src/app.ts
Normal file
8
src/app.ts
Normal 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
16
src/demo-route.ts
Normal 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
8
src/dev.ts
Normal 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
4
src/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { app } from './app.ts';
|
||||
import './demo-route.ts';
|
||||
|
||||
export { app };
|
||||
9
src/modules/mark.ts
Normal file
9
src/modules/mark.ts
Normal 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
1
src/modules/sequelize.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { sequelize } from '@kevisual/code-center-module';
|
||||
9
src/modules/user.ts
Normal file
9
src/modules/user.ts
Normal 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();
|
||||
Reference in New Issue
Block a user