2020-04-23 18:07:55 +02:00
|
|
|
import Controller from "wms-core/Controller";
|
|
|
|
import {Request, Response} from "express";
|
|
|
|
|
|
|
|
export default class HomeController extends Controller {
|
2020-10-05 13:38:03 +02:00
|
|
|
public routes(): void {
|
2020-04-23 18:07:55 +02:00
|
|
|
this.get('/', this.getHome, 'home');
|
|
|
|
this.get('/about', this.getAbout, 'about');
|
2020-09-03 11:46:00 +02:00
|
|
|
this.get('/back', this.goBack, 'about');
|
2020-04-23 18:07:55 +02:00
|
|
|
}
|
|
|
|
|
2020-10-05 13:38:03 +02:00
|
|
|
protected async getHome(req: Request, res: Response): Promise<void> {
|
2020-04-23 18:07:55 +02:00
|
|
|
res.render('home');
|
|
|
|
}
|
|
|
|
|
2020-10-05 13:38:03 +02:00
|
|
|
protected async getAbout(req: Request, res: Response): Promise<void> {
|
2020-04-23 18:07:55 +02:00
|
|
|
res.render('about');
|
|
|
|
}
|
2020-09-03 11:46:00 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is to test and assert that wms-core extended types are available
|
|
|
|
*/
|
2020-10-05 13:38:03 +02:00
|
|
|
protected async goBack(req: Request, res: Response): Promise<void> {
|
2020-09-03 11:46:00 +02:00
|
|
|
res.redirectBack();
|
|
|
|
}
|
2020-10-05 13:38:03 +02:00
|
|
|
}
|