Summary

Like the last chapter, all code samples seen here as well as some extra material can be found online in the repository available at https://github.com/joh nbrett/Getting-Started-with-hapi.js. This chapter had more code than the previous chapters, so I encourage you to take a deeper look, run some examples, and try expanding them where possible. If you have any questions about the code samples in trying to understand the code snippets, or have problems running them, feel free to open an issue.

In this chapter, we looked at the different ways we can structure a code base with hapi using some of the tools provided by the hapi ecosystem, such as plugins. We looked in detail at the plugin API, how to write our own plugins, how to integrate third-party plugins, manage dependencies, and facilitate communication between plugins with server.expose(). We also took a quick look at the some of the plugins in the hapi ecosystem.

Finally, we looked at alternative methods of managing our server, connection, and plugin configuration by reducing it to a single configuration object. We then covered multiple ways of launching our applications using this configuration object by using two modules from the hapi ecosystem: glue and rejoice.

Hopefully, at this stage you have a basic understanding of how you would add more functionality to a hapi server while keeping the code structured and manageable.

In the next chapter, we'll take a step closer to making a server production ready by looking at testing, and the importance of test coverage.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.9.124