3.2.0 • Published 6 years ago

sassi-server-api v3.2.0

Weekly downloads
13
License
MIT
Repository
github
Last release
6 years ago

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

3.2.0

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.4.3

6 years ago

2.4.2

6 years ago

2.3.0

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.0

6 years ago