🤖 Merge PR #44723 @types/dogapi Add optional api_host by @omakoleg

* Add optional api_host 

Use case:
```
  dogapi.initialize({
    api_host: 'api.datadoghq.eu',
    api_key,
    app_key
  })
```

* Modify tests
This commit is contained in:
Oleg 2020-05-15 12:18:14 +02:00 committed by GitHub
parent 8f662ae62d
commit f3bf99433b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -5,10 +5,15 @@ dogapi.initialize({
app_key: '',
});
dogapi.initialize({
api_host: 'a',
api_key: 'b',
app_key: 'c',
});
dogapi.event.create('', '', (err: Error | null, res: dogapi.EventCreateResponse) => {});
dogapi.event.create(
'',
'',
{ date_happened: Math.floor(Date.now() / 1000) },
(err: Error | null, res: dogapi.EventCreateResponse) => {}
(err: Error | null, res: dogapi.EventCreateResponse) => {},
);

View File

@ -7,6 +7,7 @@
export function initialize(opts: {
api_key: string,
app_key: string,
api_host?: string
}): void;
interface event {