CHAPTER 11

image

Database, Keys and Stream Tips

This chapter continues the previous chapter’s theme of better code organization in Express.js apps. The chapter provides tips on how to connect to a database from another module, access keys and passwords that ought to remain secret, and stream data.

Using Databases in Modules

This section deals with code organizing patterns. It is not a detailed tutorial on databases and Express.js. For such coverage, refer to Chapters 20 to 22.

Before I show you how to approach accessing a database connection from another module, which might be needed if you abstracted routes into separate app.js/server.js files, let’s ...

Get Pro Express.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.