24 lines
568 B
TypeScript
24 lines
568 B
TypeScript
import { App } from '@kevisual/router/mod.ts';
|
|
// @ts-types="https://esm.xiongxiao.me/@kevisual/router/dist/router.d.ts?raw"
|
|
|
|
console.log('meta', import.meta.url)
|
|
// deno run --allow-all index.ts
|
|
// deno run --config ./deno.json --allow-all index.ts
|
|
console.log('hello world');
|
|
|
|
const app = new App();
|
|
|
|
app
|
|
.route({
|
|
path: 'demo',
|
|
})
|
|
.define(async (ctx) => {
|
|
ctx.body = 'hello world';
|
|
})
|
|
.addTo(app);
|
|
|
|
app.listen(3000, () => {
|
|
console.log('Server is running on http://localhost:3000');
|
|
});
|
|
|
|
console.log(`http://localhost:3000/api/router?path=demo`); |