[x] Endpoint names are unnecessarily duplicated between filenames and config.ROUTES. Instead of depending on a list of endpoint names set in config.js, dynamically load endpoints based on their definitions in the routes directory.
[x] Endpoints are modular and have little code-duplication, which is a major improvement over the necessary copy-and-pasting to add a new endpoint to the legacy API. However, passing a configuration hash to a centralized function that takes care of creating the endpoints seems backwards. Instead, there should be an Endpoint class defined centrally that is instantiated in each endpoint's definition, and that endpoint should call the function that defines itself on the app object. Exploring ES6's chapter on Classes is an excellent resource on the subject.
Testing is severely lacking. The existing regression test is a simplistic approach to ensuring that the API works from the outside, but there is no functional testing to ensure that each function is performing as expected.
[ ] Test coverage of helper functions located in /helpers.
[ ] Test coverage of endpoint getter and processor functions with dummy data.
[x] Test schema of JSON returned in regression test to ensure that the API is returning the correct types of data.
[x] Test API under load conditions.
Code formatting is not standardized.
[x] Add .jshintrc and .eslintrc and fix all issues that come up (copy files from GoCoStudent).
config.ROUTES
. Instead of depending on a list of endpoint names set inconfig.js
, dynamically load endpoints based on their definitions in theroutes
directory.Endpoint
class defined centrally that is instantiated in each endpoint's definition, and that endpoint should call the function that defines itself on theapp
object. Exploring ES6's chapter on Classes is an excellent resource on the subject./helpers
.getter
andprocessor
functions with dummy data..jshintrc
and.eslintrc
and fix all issues that come up (copy files from GoCoStudent).function () {}
with() => {}
.var
with eitherlet
orconst
.