17 lines
330 B
TypeScript
17 lines
330 B
TypeScript
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');
|