Compare commits

..

2 Commits

Author SHA1 Message Date
80248c77d0 2.0.4 2018-08-11 15:09:19 +02:00
f592150646 fix(host handling): update 2018-08-11 15:09:19 +02:00
5 changed files with 29 additions and 4 deletions

View File

@ -1,5 +1,8 @@
{
"npmci": {
"npmAccessLevel": "public"
},
"npmdocker": {
}
}

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "smartnginx",
"version": "2.0.3",
"version": "2.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartnginx",
"version": "2.0.3",
"version": "2.0.4",
"private": false,
"description": "control nginx from node, TypeScript ready",
"main": "dist/index.js",

View File

@ -1,5 +1,15 @@
import * as plugins from './smartnginx.plugins';
export class CertHandler {
private _readyDeferred = plugins.smartpromise.defer();
certHandlerReady = this._readyDeferred.promise;
constructor() {} // nothing to do here for now
/**
* ensure a cert is at the right location
* @param hostName
*/
async ensureCertForHost(hostName) {
}
}

View File

@ -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
*/