Skip to content

Commit

Permalink
Use Quarkus application framework - adapt README
Browse files Browse the repository at this point in the history
  • Loading branch information
SvenWoltmann committed Oct 27, 2023
1 parent ca10b65 commit 98f305c
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,22 +36,25 @@ The `model` module is not represented as a hexagon because it is not defined by

# How to Run the Application

The easiest way to run the application is to start the `main` method of the `Launcher` class (you'll find it in the `boostrap` module) from your IDE.
You can run the application in Quarkus dev mode with the following command:

You can use one of the following VM options to select a persistence mechanism:
```shell
mvn quarkus:dev
```

You can use one of the following system properties to select a persistence mechanism:

* `-Dpersistence=inmemory` to select the in-memory persistence option (default)
* `-Dpersistence=mysql` to select the MySQL option

If you selected the MySQL option, you will need a running MySQL database. The easiest way to start one is to use the following Docker command:
For example, to run the application in MySQL mode, enter:

```shell
docker run --name hexagon-mysql -d -p3306:3306 \
-e MYSQL_DATABASE=shop -e MYSQL_ROOT_PASSWORD=test mysql:8.1
mvn quarkus:dev -Dpersistence=mysql
```

The connection parameters for the database are hardcoded in `RestEasyUndertowShopApplication.initMySqlAdapter()`. If you are using the Docker container as described above, you can leave the connection parameters as they are. Otherwise, you may need to adjust them.

In dev mode, Quarkus will automatically start a MySQL database using Docker,
and it will automatically create all database tables.

# Example Curl Commands

Expand Down

0 comments on commit 98f305c

Please sign in to comment.