Summary
In this chapter we built a functioning nanoservice that has a core layer, data access layer, and a networking layer. While getting there took a bit of refactoring, we resulted in a well-structured server where all the layers compile together to be served by the networking layer. To aid in the error handling we also built a glue module that was used by all layers, enabling us to propagate the same error type through all the layers in the nanoservice. At this stage, slotting in other web framework or data storage approach is as simple as creating another cargo workspace in the networking layer, or another feature in the data access layer. In addition, we chained factories to enable our views to be constructed on the fly and added to the server. With this chained factory mechanism, we can slot entire view modules in and out of the configuration when the server is being built.
In the next chapter, we will work with processing requests and responses. We will learn how to pass params...