Converting a monolithic application to a microservice gateway

We already have our monolithic application generated, as well as our entities. As a part of monolithic application generation, we have already selected some options via JHipster CLI. We will stick to the same options (the database, authentication type, package name, i18n, and so on) when we generate the microservice gateway application. 

Note: We will see how the customizations that we applied in the monolithic app can be applied to the gateway later.

It's coding time now, so let's start building a gateway application using JHipster CLI.

The first step here is to convert the monolithic app into a microservice gateway application with almost the same configuration that we used when we created a monolithic application.

Let's move to the Terminal (Command Prompt, if you are using Windows) now, and start by navigating to the folder where we created the monolithic application. Once you're in the folder, create a new Git branch so that we can do a clean merge back to master once we are done:

> cd e-commerce-app/online-store
> git checkout -b gateway-conversion

Now, open the .yo-rc.json file in your favorite text editor or IDE and change the following value:

In order to make the monolith into a microservice gateway application, we can just change the preceding values in the .yo-rc.json file. We have added the service discovery type to Eureka since for monolithic applications, it is not mandatory to have service discovery.

Also, obviously, the next change is to change the application type from monolith to gateway.