Guest User

Untitled

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. constructor(private http: HttpClient) {
  2. http.get('http://localhost:8080/resource').subscribe(data => this.greeting = data);
  3. }
  4.  
  5. @RequestMapping("/resource")
  6. public Map<String,Object> home() {
  7. Map<String,Object> model = new HashMap<String,Object>();
  8. model.put("id", UUID.randomUUID().toString());
  9. model.put("content", "Hello World");
  10. return model;
  11. }
  12.  
  13. response.setHeader("Access-Control-Allow-Origin", "*");
  14. response.setHeader("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS, DELETE");
Add Comment
Please, Sign In to add comment