Package org.foo

Source Code of org.foo.MyMain

package org.foo;

import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.deploy.Verticle;

import java.lang.System;
import com.acme.OtherClass;

public class MyMain extends Verticle {

  public void start() {

    vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() {
      public void handle(HttpServerRequest req) {
        System.out.println("Got request: " + req.uri);
        req.response.headers().put("Content-Type", "text/html; charset=UTF-8");
        // Make sure we can reference another source file:
        OtherClass otherClass = new OtherClass();
        req.response.end("<html><body><h1>Hello from vert.x! " + otherClass.date() + "</h1></body></html>");
      }
    }).listen(8080);
  }
}
TOP

Related Classes of org.foo.MyMain

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.