This demo shows a very simple hello world Vert.x project for Cloud Foundry. It has a simple HTTP server which simply serves the /webroot/index.html
.
This demo uses Vert.x and is packed using the official CloudFoundry java-buildpack. The manifest.yml
specifies the app’s memory to be 768MB because any lower and the java-buildpack throws an error that it can’t allocate enough heap space. (See the list of certified platforms).
The environment variable PORT
is normally provided by your CloudFoundry service, and therefore can change when being deployed. Otherwise the default port is 8080
.
The webroot
is located under src/main/java/resources
so it can be packaged into the JAR file. If the webroot
is not packaged inside the JAR file like this, then we can’t deploy it easily to CloudFoundry using the java-buildpack. A custom buildpack would have to be created instead. But that’s beyond the scope of this demo.
This demo also uses Gradle+shadowJar plugin to build the application and all it’s dependencies into a single "fat" jar.
Run build ./gradlew clean build
Test app java -jar build/libs/vertx-cf-0.1.0-all.jar
Visit http://localhost:8080/ to see the app running.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。