1 Star 0 Fork 0

王东祥/vertx-examples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.adoc 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
Austin M. Delamar 提交于 2017-12-14 09:22 . Fix link and Future complete

Vert.x on Cloud Foundry

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.

Prerequisites

Build fat jar

  1. Run build ./gradlew clean build

  2. Test app java -jar build/libs/vertx-cf-0.1.0-all.jar

  3. Visit http://localhost:8080/ to see the app running.

Deploy to Cloud Foundry

  1. Deploy cf push -f manifest.yml myapp

  2. Run cf apps to see the app running. Visit the url provided.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/doney/vertx-examples.git
git@gitee.com:doney/vertx-examples.git
doney
vertx-examples
vertx-examples
master

搜索帮助