审计记录

src/main/java/com/xxxcom/xxxproduct/MyFirstVerticle.java 691 字节
胡敏 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
package com.xxxcom.xxxproduct;
 

import io.vertx.core.AbstractVerticle;
import io.vertx.core.http.HttpServerResponse;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.jdbc.JDBCClient;
import io.vertx.ext.web.Router;

public class MyFirstVerticle extends AbstractVerticle {
	 
	@Override
	public void start() throws Exception {
		Router router = Router.router(vertx);

		// Bind "/" to our hello message - so we are still compatible.
		router.route("/").handler(routingContext -> {
			HttpServerResponse response = routingContext.response();
			response.putHeader("content-type", "text/html;charset=UTF-8")
					.end("<h1>Hello from my first Vert.x 3 application</h1>");
		});
	}
}