mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-03-31 06:24:02 -04:00
27 lines
671 B
JavaScript
27 lines
671 B
JavaScript
const config = require("../../config/config");
|
|
|
|
class BaseController {
|
|
constructor() {
|
|
this.baseConfig = {
|
|
config: config,
|
|
hostname: '',
|
|
baseUrl: ''
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Returns the complete config base + page specific
|
|
*
|
|
* @param request
|
|
* @param pageSpecificConfig
|
|
*/
|
|
mergePageConfig(request, pageSpecificConfig) {
|
|
this.baseConfig.hostname = request.hostname;
|
|
this.baseConfig.baseUrl = `${request.protocol}://${request.hostname}${config.application.basePath}`;
|
|
|
|
return Object.assign(this.baseConfig, pageSpecificConfig);
|
|
}
|
|
}
|
|
|
|
module.exports = BaseController;
|