title: Vert.x way of launching an app and config file
body: <p>I still have some misunderstanding about the way vertx suppose you'll deploy/start yor app. Still there are two questions, but they are hardly related for me.</p>
  <p><em><strong>Question 1:</strong></em> <em>I there a way to make your app launchable from both: command line and IDEA?</em></p>
  <p>In one hand there is a <a href="http://vertx.io/docs/apidocs/io/vertx/core/Starter.html" rel="nofollow noreferrer"><code>Starter</code></a> class (provided by Vert.x) to launch our application from command line. It provides <code>main</code> method for you. But if I launch it from  shell I won't have an ability to debug it, right?</p>
  <p>In other hand to lanch your app in IDEA you need to create main method manually. Also <a href="http://vertx.io/blog/vert-x-application-configuration/index.html" rel="nofollow noreferrer">some features like configurations file</a> are described only for command line way. I.e. <code>java -jar target/my-first-app-1.0-SNAPSHOT-fat.jar -conf src/main/conf/my-application-conf.json</code></p>
  <p><em><strong>Question 2:</strong></em> <em>How to set configuration file programmatically?</em></p>
  <p>I have a <code>ServerVerticle</code>, all questions there:</p>
  <pre><code>public class ServerVerticle extends AbstractVerticle {
  
      //QUESTION 1: I need this method for IDEA debugging, but don't need when launch app from command line. How to be??
      public static void main(String[] args) {
          Consumer&lt;Vertx&gt; runner = vertx -&gt; {
              try {
                  vertx.deployVerticle(&quot;server.ServerVerticle&quot;, new DeploymentOptions());
              } catch (Throwable t) {
                  t.printStackTrace();
              }
          };
          Vertx vertx = Vertx.vertx(new VertxOptions());
          runner.accept(vertx);
      }
  
      @Override
      public void start() {
          vertx.deployVerticle(...); //deploy another verticles
          //QUESTION 2: how to pass configuration file programmaticaly in vertx? I can parse json file with java I/O, but if some configs are used accross the whole app?
          vertx.createNetServer()
               .connectHandler(this::handleMessage)
               .listen(8080, &quot;localhost&quot;);
      }
     
  
  }
  </code></pre>