Azure Functions App Client
Overview
Client libaray for CloudHospital.IntegratedServicesFunctionsApp Azure Functions App.
Usages
Install
$ npm i --save @cloudhospital/integratedservicesfunctionsapp.client
Example
import { CreateGitHubIssueClient } from '@cloudhospital/integratedservicesfunctionsapp.client';
import { type GitHubIssueRequestModel } from '@cloudhospital/integratedservicesfunctionsapp.client';
// ...
const createGitHubIssueClient = new CreateGitHubIssueClient({
apiKey: '<api-key>',
baseUrl: '<Base url of Azure Functions App>',
});
let model: GitHubIssueRequestModel;
try {
throw new Error('Test error');
} catch (err) {
if (err instanceof Error) {
model = {
owner: process.env.OWNER ?? '',
repo: process.env.REPO ?? '',
stage: process.env.STAGE ?? '',
error: {
message: err.message,
stack: err.stack,
},
note: `You can provide more information
**Markdown** supported. ;)
`,
};
await createGitHubIssueClient.requestAsync(model);
}
}