Advertisement
shakasu

Untitled

Feb 24th, 2021
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. import io.vertx.core.Vertx;
  2. import io.vertx.core.http.HttpServer;
  3. import io.vertx.core.http.HttpServerResponse;
  4. import io.vertx.core.net.SocketAddress;
  5.  
  6. public class Sandbox {
  7.     final private static int PORT_TDG = 8181;
  8.     final private static int PORT_MY = 8080;
  9.     final private static String HOST = "localhost";
  10.     final private static String TOKEN = "9f226286-e0d8-4125-ad43-b123b4e464da";
  11.     final private static String TYPE = "application/json;charset=utf-8";
  12.  
  13.  
  14.     public static void main(String[] args) {
  15.         Vertx vertx = Vertx.vertx();
  16.         HttpServer server = vertx.createHttpServer();
  17.  
  18.         server.requestHandler(request -> {
  19.  
  20.             // This handler gets called for each request that arrives on the server
  21.             HttpServerResponse response = request.response();
  22.             response.putHeader("content-type", "text/plain");
  23.  
  24.             // Write to the response and end it
  25.             response.end("Hello World!");
  26.         });
  27.  
  28.         server.listen(SocketAddress.domainSocketAddress(String.format("%s/%s//api/migrate/graphql", HOST, PORT_MY)));
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement