# sassi-server-api

> Secret API for Service Server and Build Info (Server API)

Latest version **3.2.0** (published 2018-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install sassi-server-api
pnpm add sassi-server-api
yarn add sassi-server-api
bun add sassi-server-api
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2018-01-29 |
| First published | 2018-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | highseas |

## Links

- npm: https://www.npmjs.com/package/sassi-server-api
- Repository: https://github.com/highseas/sassi
- npm.io page: https://npm.io/package/sassi-server-api

## Dependencies (3)

- [sassi-api](https://npm.io/package/sassi-api.md) ^3.2.0
- [sassi-core](https://npm.io/package/sassi-core.md) ^3.2.0
- [@types/node](https://npm.io/package/@types/node.md) ^8.5.2

## Recent versions

- 3.2.0 (latest) — 2018-01-29
- 3.1.1 — 2018-01-26
- 3.1.0 — 2018-01-26
- 3.0.0 — 2018-01-25
- 2.4.3 — 2018-01-24
- 2.4.2 — 2018-01-24
- 2.3.0 — 2018-01-19
- 2.2.1 — 2018-01-08
- 2.2.0 — 2018-01-08
- 2.1.0 — 2018-01-08

## README

# sassi-server-api

## Installation

    yarn add sassi-server-api


## Overview
Because the server API can be hosted in different frameworks (and outside of node),
this package just has a few helpers that can be used by the real server to host
the API. Essentially, the sassi-server-api is r provides two things:

1. SassiApiServerConfig - the configuration required to host the API itself
2. Helper methods for auth and HTML generation.

## SassiApiServerConfig
The SassiApiServerConfig builds off the sassi-api/SassiApiConfig.
It extends it with an interface that specifies two methods the server must provide:

* fetchBuildData
* fetchServerData

### fetchBuildData() : IBuildData
This is a callback the server can provide the IBuildData.
It can simply just load the build.json file provided by sassi-build-data and server it


### fetchServerData() : IServerData
This is a callback the server can provide the IServerData.
The server can provide:

    * start/fetch times
    * service info (azure host information, for instance)
    * env information

Although the env and service info probably wont change (without restarts), the time should be generated each call.


### verifyBasicAuthHeader
This just works with the client to provide basic auth (so you don't have to parse it) .

### getDefaultHtml
If you want to provide an HTML version of your JSON, this is a simple default version.


## Example Usage
You can see an example in the sassi-express-api

---
_Source: https://npm.io/package/sassi-server-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
