Skip to content

Instantly share code, notes, and snippets.

@melardev
Created February 21, 2019 13:53
Show Gist options
  • Save melardev/4e25e7365415e2e1cbaaaf6acbfc7127 to your computer and use it in GitHub Desktop.
Save melardev/4e25e7365415e2e1cbaaaf6acbfc7127 to your computer and use it in GitHub Desktop.
Spring Cloud Rest app
package com.melardev.cloud.rest.controllers;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HomeController {
@Value("${app.id}")
String instance;
@GetMapping("/")
public String hi() {
return "Welcome, I am " + instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment