[microservice-utilities] Rewrite example file

This commit is contained in:
runebaas
2018-12-08 01:39:53 +01:00
parent de00f487a8
commit a4682d23b0
2 changed files with 13 additions and 9 deletions
@@ -1,13 +1,17 @@
import { Authorizer, PlatformClient, RequestLogger, ServiceTokenProvider } from 'microservice-utilities';
const authorizer = new Authorizer((msg: any) => msg, {jwkKeyListUrl: 'aaa'});
const authorizerPolicy = authorizer.getPolicy({test: true});
(async (): Promise<void> => {
const authorizer = new Authorizer((msg: any) => msg, { jwkKeyListUrl: 'aaa' });
const authorizerPolicy = authorizer.getPolicy({ test: true });
const platformClient = new PlatformClient((msg: any) => msg);
platformClient.get('https://www.typescriptlang.org/');
platformClient.post('https://www.typescriptlang.org/', {testData: 'abc'});
const platformClient = new PlatformClient((msg: any) => msg);
const result = await platformClient.get('https://www.typescriptlang.org/');
const data = result.data as string;
const serviceTokenProvider = new ServiceTokenProvider(platformClient, {});
platformClient.post('https://www.typescriptlang.org/', { testData: 'abc' });
const requestLogger = new RequestLogger({jsonSpace: 4});
requestLogger.log('hello world');
const serviceTokenProvider = new ServiceTokenProvider(platformClient, {});
const requestLogger = new RequestLogger({ jsonSpace: 4 });
requestLogger.log('hello world');
})();
+1 -1
View File
@@ -7,7 +7,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"