title: localhost refused to connect with Intellij Maven project
body: <p>I have some really simple code and am currently trying to get <a href="http://sparkjava.com/documentation#getting-started" rel="nofollow noreferrer">this</a> beginning Spark project up and running.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>import static spark.Spark.*;
  
  public class Main {
      public static void main(String[] args) {
          get("/hello", (req, res) -&gt; "Hello World");
      }
  }
  </code></pre>
  
  <p>and I get an this error when I go to run <a href="http://localhost:4567/hello" rel="nofollow noreferrer">http://localhost:4567/hello</a></p>
  
  <pre><code>localhost refused to connect.
  ERR_CONNECTION_REFUSED
  </code></pre>
  
  <p>Also the pom.xml file if needed</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
  &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt;
  &lt;artifactId&gt;my-app&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.8&lt;/source&gt;
                  &lt;target&gt;1.8&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sparkjava&lt;/groupId&gt;
          &lt;artifactId&gt;spark-core&lt;/artifactId&gt;
          &lt;version&gt;2.5&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p></p>