Develop & deploy Pivotal web service using STS in 15 minutes
1. New a spring starter project
2. Add greeting.java
package com.example;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class Greeting {
@RequestMapping("/greeting")
public @ResponseBody String greeting(){
return "Welcome to Cloud Foundry @Gary Liu";
}
}
3. Deploy to pivotal, choose subdomain to be 'demo-gary'
4. Access http://demo-gary.cfapps.io/greeting
5. Done
Reference:
https://spring.io/guides/gs/sts-cloud-foundry-deployment/