我在打字稿中有一个模块,其中包含以下代码。
export class Account {
constructor(app: any) {
this.initialize(app);
}
private initialize(app: any) {
app.get("/login", (req: any, res: any) => {
res.render("index", { user: req.user });
});
app.get("/logout", (req: any, res: any) => {
res.render("index", { user: req.user });
});
}
}
我想在主文件中加载这个模块。喜欢
require('/mymodule')(app)
我怎么能在打字稿中做到这一点?