DTP Base provides a scalable and secure Node.js application development harness ready for production service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

39 lines
807 B

// home.js
// Copyright (C) 2024 DTP Technologies, LLC
// All Rights Reserved
'use strict';
import express from 'express';
import { SiteController } from '../../lib/site-controller.js';
export default class HomeController extends SiteController {
static get name ( ) { return 'HomeController'; }
static get slug ( ) { return 'home'; }
static create (dtp) {
const instance = new HomeController(dtp);
return instance;
}
constructor (dtp) {
super(dtp, HomeController.slug);
this.dtp = dtp;
}
async start ( ) {
const router = express.Router();
this.dtp.app.use('/', router);
router.get('/', this.getHome.bind(this));
return router;
}
async getHome (req, res) {
res.locals.pageDescription = 'DTP Chat Home';
res.render('home');
}
}