Skip to content

Configuring Client → Web API → MongoDB

Aaron Hanusa edited this page Mar 11, 2019 · 6 revisions

Client → Web API → MongoDB

architecture

In this scenario, the client consumes business services that are injected with data proxies that use HTTP to communicate with the Web API application. In turn, the Web API application uses business services that are injected with data proxies that communicate with a MongoDB database.

To configure the react client to consume http data proxies that communicate with the Web API, open businessLogic.js and follow these steps:

1.) Locate and comment the following line:

// configureInMemory();

2.) Locate and uncomment the following line:

configureHttp();

To configure the server to consume MongoDB data proxies, open wireUpRoutes.js and follow these steps:

1.) Locate and comment the following line:

// var proxyFactory = require('./data_proxies/in-memory/inMemoryDataProxyFactory');

2.) Locate and uncomment the following line:

var proxyFactory = require('./data_proxies/mongo/mongoDataProxyFactory');

3.) Restart the application to ensure that the new proxies are consumed.

Clone this wiki locally