2016-05-03 10 views
0

Ich habe eine Tomcat-Servlet-basierte Web-Anwendung entwickelt, die ich auf meinem lokalen Rechner ausführen kann. Ich sende es Anfragen, indem Sie einen JSON zu ihm:deploy tomcat servlet project auf heroku

"curl ontent-type: application/json" --request POST --data '{"username":"Piran", "password":"123", "requestedUsername":"hsn.vahedi", "requestedPassword":"111", "role":"client", "firstName":"Hossein", "lastName":"Vahedi", "phoneNumber":"09212814194"}' localhost:8080/myApp/register" 

und es gibt mir die richtige json Antwort. Aber wenn ich auf diese Weise meine Anwendung auf Heroku bereitstellen: https://devcenter.heroku.com/articles/java-webapp-runner und ihm eine Anfrage schicken, es gibt mir diese Antwort:

<!DOCTYPE html> 
    <html> 
    <head> 
     <title>Heroku | Welcome to your new app!</title> 
     <style type='text/css'> 
     body { 
     background-color: white; 
     color: #333333; 
      font-family: Arial, sans-serif; 
     margin: 0; 
     padding: 36px; 
     line-height: 1; 
     font-size: 14px; } 

     .section { 
     margin-bottom: 36px; } 
     .section.friendly { 
      color: #222222; } 
      .section.friendly h1 { 
      font-size: 26px; 
      background-color: #dad8e4; 
      padding: 18px 22px 15px 22px; 
      margin: 0; 
      overflow: hidden; } 
      .section.friendly h1 strong { 
       display: inline-block; 
       float: left; } 
      .section.friendly h1 small { 
       display: inline-block; 
       float: right; 
       text-align: right; 
       font-size: 18px; 
       padding-top: 4px; 
       color: #333333; } 
      .section.friendly .article { 
      border: 4px solid #dad8e4; 
      padding: 24px 18px 18px 18px; } 
      .section.friendly .article h3 { 
       font-size: 20px; 
       margin: 0 0 18px 0; } 
      .section.friendly .article a { 
       color: #6b6ceb; } 
       .section.friendly .article a:visited { 
       color: #1d1d3b; } 
      .section.friendly .article p { 
       font-size: 14px; } 
      .section.friendly .article ul { 
       list-style-type: square; } 
     .section.original { 
     background-color: #eeeeee; 
     color: #444444; } 
     .section.original h2 { 
      background-color: #dddddd; 
      margin: 0; 
      padding: 18px 22px 18px 22px; 
      font-size: 20px; } 
     .section.original pre { 
      margin: 0; 
      padding: 18px 22px 18px 22px; 
      overflow: auto; 
      font-family: monaco, monospaced; } 
      .section.original pre code { 
      display: block; 
      font-size: 11px; 
      width: 100%; } 
    </style> 
    </head> 
    <body> 
     <div class='container'> 
      <div class='section friendly'> 
      <h1><strong>Heroku | Welcome to your new app!</strong></h1> 
      <div class='article'> 
       <p>Refer to the <a href="//devcenter.heroku.com/">documentation</a> if you need help deploying.</p> 
      </div> 
      </div> 
     </div> 
    </body> 
    </html> 

Was ist das Problem? Vielen Dank!

+0

Sie haben Ihre App nicht ordnungsgemäß bereitgestellt oder die falsche URL verwendet, sodass die Standardantwort von heroku angezeigt wird. – zapl

+0

@zapl Die URL ist nicht falsch. Ich bin mir sicher. – HsnVahedi

+0

@zapl Sie hatten Recht. Die App wurde nicht ordnungsgemäß bereitgestellt. Vielen Dank! – HsnVahedi

Antwort