Remove reliance on global state
Review Request #9782 — Created March 15, 2018 and submitted — Latest diff uploaded
This patch is a cleanup of the API routes. The major change is that we
now have anAPI
type which contains the API methods. With this change,
the routes now have access to the API's configuration so we no longer
need a globalConfig
object!Additionally, some cleanup has been done to the routes that require a
repository with theapi.withRepository
middleware, which provides the
requested repository as the"repo"
context variable (instead of having
each route retrieve it and do error checking). Routes have been
re-written to have a simpler error-checking flow as well.
Ran unit tests.