Vert.x-Gradle-Simple is a Hello World Vert.x 3.1 project using the Gradle build system. It initializes a simple HTTP server which simply returns "Hello World!" with every request given to it.
In this example, Vert.x is used in an embedded fashion. It uses Vert.x APIs directly in its classes rather than deploying code in verticles.
-
Download Java 8 JDK for your Operating System!
-
Make sure you have declared the
JAVA_HOME
environment variable to the directory where JDK was installed. -
Fork the repository by clicking on the Fork icon at the top right corner of this page.
-
Clone the repository to your local machine by running the following commands on git:
```$ git clone https://github.com/[YOUR-USERNAME]/vertx-gradle-simple```
-
If you need help, refer Forking and Cloning in git. You can also ask for help in our gitter channel.
-
If not using Git, then simply download the .zip file of this repository and unzip the file.
-
Download Vert.x from http://vertx.io/
-
If you prefer using an IDE, install IntelliJ IDEA or any other preferred IDE for Java Application Development.
-
Configure Java SDK version by going to :
* File ---> Project Structure ---> Project Settings ---> Set the project SDK to **Java version 1.8**
- Import the cloned repository into your IDE
- Right click on the vertx at the top of the code and use the suggested help from IntelliJ to link it to the project
- Right click the HelloWorldEmbedded class
- Click Run as...
Directly run the application using the gradle plugin in the command line with ./gradlew run
on Linux/macOS OR gradlew run
on Windows.
- If permission is denied, then run cmd as admin (for Windows) or use
chmod +x ./gradlew
(for Linux/Unix)
Visit http://localhost:8080 on your browser
If everything was setup correctly, you will see "Hello World"
displayed in your browser.
You can try and edit the request handler response in the HelloWorldEmbedded java file.
- Make your intended changes on your locally cloned repository.
- Add a new branch with a meaningful name indicating your change (i.e. Add-Unit-Tests).
- Commit the changes and Push the commit to your forked repository on GitHub.
- Ensure the changes on the commit pushed to your GitHub fork are correct.
- Create a pull request requesting to merge the commits on your fork to this repository.
- Write a very conscise but informative pull request message. Remember to use your words wisely!