I have a module in typescript which contains the following code.
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 });
});
}
}
And I want to load this module in main file. like
require('/mymodule')(app)
How I can do this in typescript ?
Proper way:
More
Just some free docs