fix(core): update

This commit is contained in:
Philipp Kunz 2019-08-20 18:42:52 +02:00
parent 855ede784d
commit 0a8ae81fd0
8 changed files with 1475 additions and 20 deletions

1418
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -20,5 +20,10 @@
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {}
"dependencies": {
"@types/express": "^4.17.1",
"@types/http-proxy-middleware": "^0.19.3",
"express": "^4.17.1",
"http-proxy-middleware": "^0.19.1"
}
}

View File

@ -1,8 +1,8 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartproxy from '../ts/index'
import * as smartproxy from '../ts/index';
tap.test('first test', async () => {
console.log(smartproxy.standardExport)
})
console.log(smartproxy);
});
tap.start()
tap.start();

View File

@ -1,3 +1 @@
import * as plugins from './smartproxy.plugins';
export let standardExport = 'Hi there! :) This is an exported string';
export * from './smartproxy.classes.smartproxy';

7
ts/interfaces/index.ts Normal file
View File

@ -0,0 +1,7 @@
export interface IHostConfig {
hostName: string;
destination: string;
destinationPort: number;
privateKey: string;
publicKey: string;
}

View File

@ -0,0 +1,5 @@
import * as plugins from './smartproxy.plugins';
export class SmartproxyRouter {
}

View File

@ -0,0 +1,29 @@
import * as plugins from './smartproxy.plugins';
import * as interfaces from './interfaces';
import { SmartproxyRouter } from './smartproxy.classes.router';
export class SmartProxy {
public expressInstance: plugins.express.Express;
public httpsServer: plugins.https.Server;
public router = new SmartproxyRouter();
public hostCandidates: interfaces.IHostConfig[] = [];
public addHostCandidate(hostCandidate: interfaces.IHostConfig) {
// TODO search for old hostCandidates with that target
this.hostCandidates.push(hostCandidate);
};
/**
* starts the proxyInstance
*/
public async start() {
this.expressInstance = plugins.express();
this.httpsServer = plugins.https.createServer(this.expressInstance);
}
public async update() {
await this.start();
}
}

View File

@ -1,4 +1,15 @@
const removeme = {};
// node native scope
import * as https from 'https';
export {
removeme
}
https
};
// third party scope
import express from 'express';
import * as httpProxyMiddleware from 'http-proxy-middleware';
export {
express,
httpProxyMiddleware
};