https://github.com/xatuke/random-name-generator
for GCI
https://github.com/xatuke/random-name-generator
Last synced: 11 months ago
JSON representation
for GCI
- Host: GitHub
- URL: https://github.com/xatuke/random-name-generator
- Owner: xatuke
- License: apache-2.0
- Created: 2019-12-09T18:44:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-10T17:57:41.000Z (over 6 years ago)
- Last Synced: 2025-03-05T15:07:34.983Z (over 1 year ago)
- Language: Java
- Size: 63.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://gitter.im/JBossOutreach/gci)
# Getting started with Quarkus
This is a minimal CRUD service exposing a couple of endpoints over REST.
Under the hood, this demo uses:
- RESTEasy to expose the REST endpoints
- REST-assured and JUnit 5 for endpoint testing
## Requirements
To compile and run this demo you will need:
- JDK 1.8+
- GraalVM
### Configuring GraalVM and JDK 1.8+
Make sure that both the `GRAALVM_HOME` and `JAVA_HOME` environment variables have
been set, and that a JDK 1.8+ `java` command is on the path.
See the [Building a Native Executable guide](https://quarkus.io/guides/building-native-image-guide)
for help setting up your environment.
## Building the application
Launch the Maven build on the checked out sources of this demo:
> ./mvnw package
### Live coding with Quarkus
The Maven Quarkus plugin provides a development mode that supports
live coding. To try this out:
> ./mvnw compile quarkus:dev
This command will leave Quarkus running in the foreground listening on port 8080.
1. Visit the default endpoint: [http://127.0.0.1:8080](http://127.0.0.1:8080).
- Make a simple change to [src/main/resources/META-INF/resources/index.html](src/main/resources/META-INF/resources/index.html) file.
- Refresh the browser to see the updated page.
2. Visit the `/randomname` endpoint: [http://127.0.0.1:8080/randomname](http://127.0.0.1:8080/randomname)
- Refresh and see a new Random Name generated :)
### Run Quarkus in JVM mode
When you're done iterating in developer mode, you can run the application as a
conventional jar file.
First compile it:
> ./mvnw package
Then run it:
> java -jar ./target/getting-started-1.0-SNAPSHOT-runner.jar
Have a look at how fast it boots, or measure the total native memory consumption.
### Run Quarkus as a native executable
You can also create a native executable from this application without making any
source code changes. A native executable removes the dependency on the JVM:
everything needed to run the application on the target platform is included in
the executable, allowing the application to run with minimal resource overhead.
Compiling a native executable takes a bit longer, as GraalVM performs additional
steps to remove unnecessary codepaths. Use the `native` profile to compile a
native executable:
> ./mvnw package -Dnative
After getting a cup of coffee, you'll be able to run this executable directly:
> ./target/getting-started-1.0-SNAPSHOT-runner
Google Code-in and the Google Code-in logo are trademarks of Google Inc.