Generated pages

Let's start the application to view the generated pages. In the Terminal, execute the Gradle command, as follows:

> ./gradlew

This will start the server in development mode locally. Since the import-jdl step already compiled the frontend code, we don't have to run npm start just to see the new pages, but please note that for further development, it is better to use npm start along with the preceding command. If you had the server already running while generating the entities, then there is no need to run this command; instead, just compile the source again using the ./gradlew compileJava command or using your IDE and Spring DevTools will hot reload the application for you. If you had npm start running, then a hot reload will take place on the client-side as well; otherwise, just refresh the page. We will learn more about hot reloading in the next chapter.

Once you see the following message, the server is ready and we can navigate to the URL http://localhost:8080 in our favorite browser:

----------------------------------------------------------
Application 'store' is running! Access URLs:
Local: http://localhost:8080
External: http://192.168.2.7:8080
Profile(s): [swagger, dev]
----------------------------------------------------------

If you are not already logged in, then do so using the default admin user with the password admin by clicking on the Sign in link on the home page. Once logged in, click on the Entities link in the menu and you will see all our entities listed there:

Click on the Product and you will see the Products listing screen. It has some fake data autogenerated for development purposes, which is loaded only for the dev profile:

The loading of the fake data can be disabled by removing the faker profile in the spring.liquibase.contexts property in the application configuration file at src/main/resources/config/application-dev.yml. You can also disable the loading of fake data during the initial app creation by passing the --skip-fake-data flag to the jhipster command.

Let's create an entity. Click on the Create a new Product button on the screen and you will see the following Create or edit a Product page:

Enter the Name, Description, Price, and Size. Select an image by clicking on the Choose file button and choosing a Product Category. Now click on Save and the listing screen will be refreshed with the following success message:

The Products screen now shows our new entity with buttons for View, Edit, and Delete. There are also pagination links on the bottom. Explore the ViewEdit, and Delete buttons by clicking on each of them.

In the next section, we'll run the test code that we generated.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.228.35