mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
27 lines
348 B
TypeScript
27 lines
348 B
TypeScript
|
|
|
|
|
|
import * as Koa from "koa";
|
|
import * as mount from "koa-mount";
|
|
|
|
const a = new Koa();
|
|
|
|
a.use((next) => {
|
|
this.body = "Hello";
|
|
})
|
|
|
|
const b = new Koa();
|
|
|
|
b.use((next) => {
|
|
this.body = "World";
|
|
});
|
|
|
|
const app = new Koa();
|
|
|
|
app.use(mount("/hello", a));
|
|
app.use(mount("/world", b));
|
|
|
|
app.listen(3000);
|
|
console.log("listening on port 3000");
|
|
|