GET
request to /services/time
.
Then use Eclipse or the Command Line to deploy some changes.
Window
Preferences
General
Network Connections
SSH2
Key Management
tabGenerate RSA Key...
Save Private Key...
, accepting the defaultsOk
File
Import...
Git
Projects from Git
URI
and click Next
git@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
Finish
Configure
Convert to Maven Project
src/main/java/com/example/services/TimeService.java
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;
Team
Commit
Commit
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 master
You've just cloned, modified, and deployed a brand new app.
See your changesLearn more at the Heroku Dev Center