mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
23 lines
347 B
TypeScript
23 lines
347 B
TypeScript
import Koa = require("koa");
|
|
import mount = require("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");
|