O'Reilly logo

Pro Express.js by Azat Mardan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required