fix(host handling): update
This commit is contained in:
@ -26,10 +26,22 @@ export class SmartNginx {
|
||||
* add a host
|
||||
* @param nginxHostArg
|
||||
*/
|
||||
addHost(nginxHostArg: NginxHost) {
|
||||
this.hosts.push(nginxHostArg);
|
||||
addHost(hostNameArg: string, destinationIp: string): NginxHost {
|
||||
const nginxHost = new NginxHost(this, {
|
||||
hostName: hostNameArg,
|
||||
destination: destinationIp
|
||||
})
|
||||
this.hosts.push(nginxHost);
|
||||
return nginxHost;
|
||||
}
|
||||
|
||||
getNginxHostByHostName(hostNameArg: string): NginxHost {
|
||||
return this.hosts.find(nginxHost => {
|
||||
return nginxHost.hostName === hostNameArg;
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* listHosts
|
||||
*/
|
||||
|
Reference in New Issue
Block a user