Koala is a collection of Koa add-ons that make it easy to follow SEEK conventions around tracing, logging and metrics. Refer to the Koala manifesto for philosophy behind Koala.
yarn add seek-koala
-
AsyncMiddleware facilitates lazy loading of an asynchronously-initialised middleware.
-
ErrorMiddleware catches errors from downstream middleware.
-
MetricsMiddleware uses hot-shots to record Datadog metrics about requests and their response codes.
-
RequestLogging facilitates logging information about requests and responses.
-
SecureHeaders attaches response headers that opt-in to stricter browser security policies.
-
TracingHeaders deals with RFC002 request tracing and
User-Agent
headers. -
VersionMiddleware attaches app version information to outgoing responses.
-
Koala is not a framework
It empowers developers to quickly develop SEEK web services using Koa using whatever structure they see fit.
-
Koala does not wrap other packages
The objects and types of JavaScript packages such as Axios and hot-shots should be used directly. While Koala may provide constructors for objects from those packages, developers should always be able to "bring their own instance".
-
Koala does not contain policy
It does not enforce timeouts, set caching headers, expect certain error objects, etc. Whenever a default policy is unavoidable it should be called out in the documentation and made configurable.
-
Koala modules should be usable in isolation
An application should not have to "buy in" to all of Koala at once. Modules should not require special middleware to set up their state.
-
Koala is not innovative
It implements best practices from SEEK and follows internal SEEK RFCs and s2sauth where applicable. The modular, policy-free nature of Koala allows individual apps to opt-out of Koala's implementation for experimentation.
-
Koala is not a dumping ground
It strictly contains functionality related to developing Koa web services at SEEK. It should not include features only relevant to a single application or team.