Integration of the feature flag
After we have installed the feature flag server, we want to start using it in our application. In this section, we will look at integrating the feature flag to enable/disable certain user interface elements in the frontend and to call only the backend services from our server that are enabled.
Web application
The sample app we are going to use can be found inside the chapter11/frontend-enable-disable
folder; the sample app demonstrates how to use the feature flag to enable/disable the user interface button. Open the terminal and change into the chapter11/frontend-enable-disable
directory to run the web app as follows:
npm install npm run dev
The commands will install all the necessary packages and then run the web app. Once the command completes, open your browser and type http://localhost:3000
in the address bar. You will see the web app shown in Figure 11.5.
Figure 11.5: The initial view of the web app using the...