npm.io
3.2.0 • Published 8 years ago

sassi-api

Licence
MIT
Version
3.2.0
Deps
1
Vulns
0
Weekly
0

sassi-api

The sassi-api package is client side library for calling the sassi api hosted on the server. Assuming your service/slot is hosting the sassi-api, you can use this library to fetch the data:

const apiConfigParams: SassiApiConfig = {
    baseUrlPath: '/api/_sassi_',
    sbdJsonPath: 'sbd.json',
    sbdHtmlPath: 'sbd.html',
    creds: {
        id: 'SOME_ID',
        secret: 'SOME_SECRET_FROM_ENV'
    }
};

const sassiApiConfig = new SassiApiConfig(apiConfigParams);

const sassiApi = new SassiApi(sassiApiConfig);

const server = 'https://some-azure-service-slot.azurewebsites.com';

sassiApi
    .fetchServerBuildData(server)
    .then(sbd => {
        console.log('sbd: \n', JSON.stringify(sbd, undefined, 4));
    })
    .catch(error => {
        console.log('error:', error);
    });

The data returned sbd is the IServerBuildData defined in sassi-core.

Note, the sassi-server-api extends the sassi-api with server specific configuration, so it can be shared.