GET request to /services/time.
Then use Eclipse or the Command Line to deploy some changes.
Window Preferences General Network Connections SSH2Key Management tabGenerate RSA Key...
Save Private Key..., accepting the defaultsOkFile Import... Git Projects from Git
URI and click Nextgit@heroku.com:.git in the URI field.
Next three times
Click Yes to the question of authenticity if the question appears.
Import as general project
FinishConfigure Convert to Maven Project src/main/java/com/example/services/TimeService.javaGET /services/time/est for the time in Eastern Standard Time), add this method:
@GET
@Path("/{timezone}")
public Time get(@PathParam("timezone") String timezone) {
return new Time(TimeZone.getTimeZone(timezone.toUpperCase()));
}
Be sure to also add the necessary import statements:
import javax.ws.rs.PathParam; import java.util.TimeZone;
Team CommitCommit
Team Push to Upstream
You've just cloned, modified, and deployed a brand new app.
See your changesLearn more at the Heroku Dev Center
heroku login
Be sure to create, or associate an SSH key with your account.
$ heroku login Enter your Heroku credentials. Email: naaman@heroku.com Password: Could not find an existing public key. Would you like to generate one? [Yn] Y Generating new SSH public key. Uploading SSH public key /Users/Administrator/.ssh/id_rsa.pub Authentication successful.
git clone -o heroku git@heroku.com:.git
src/main/java/com/example/services/TimeService.java in your favorite editor.GET /services/time/est
for the time in Eastern Standard Time), add this method:
@GET
@Path("/{timezone}")
public Time get(@PathParam("timezone") String timezone) {
return new Time(TimeZone.getTimeZone(timezone.toUpperCase()));
}
Be sure to also add the necessary import statements:
import javax.ws.rs.PathParam; import java.util.TimeZone;
mvn clean package
git commit -am "New changes to deploy"git push heroku masterYou've just cloned, modified, and deployed a brand new app.
See your changesLearn more at the Heroku Dev Center