Kartotherian by now has became (first?) node-template based service used outside of WMF. In order to help develop it as a service useful to both inside and outside the foundation, it needs to be cleanly separated separated from some of the WMF-specific code, especially inside the service template. I would like to move some of the code out of the node template, but could really use service's team help to figure out how to best partition it. The major side benefit would be a much slimmer node-template that can be easily updated to the newer version of the utility libraries.
First step - lets figure out what should be moved out into separate library(ies). I identified these blocks, but there might be more, or these might need to be broken up further. I propose we move all of them into service-templatelib-node (naming?).
app.js
- initApp() global functions (metrics, logging, conf, info)
- initApp() app.conf initialization
- initApp() express initialization (cors, csp, global flags, compression, parsing, ..
- loadRoutes() auto-discovery based on files
- createServer()
api-utils
- setupApiTemplates
- basic api functionality
swagger-ui
- ?
routes
- root
- info
- ex