O'Reilly logo

The Node Craftsman Book by Manuel Kiessling

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

Making the backend recognize different environments

But we are not yet done and need to refrain from opening our app just yet.

What's the problem?

Until now, we only used the database when running the specs. Now we have another client for the web service (and the underlying database), and this is the frontend application. We probably don't want our specs to wipe out the data we add through the application. We can circumvent this problem by using the different environments we created for db-migrate. Each environment has its own database setup, and this way we can keep things neatly separated – our specs work with one database setup, and the application with another one.

We need to add a helper script that detects the current environment when ...

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