Last active
February 19, 2019 08:33
-
-
Save OmarElgabry/48fdb50fcd4adda191fd984501c3e4df to your computer and use it in GitHub Desktop.
Eureka Image Service Controller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eureka.image.controllers; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.core.env.Environment; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.RestController; | |
| import com.eureka.image.entities.Image; | |
| @RestController | |
| @RequestMapping("/") | |
| public class HomeController { | |
| @Autowired | |
| private Environment env; | |
| @RequestMapping("/images") | |
| public List<Image> getImages() { | |
| List<Image> images = Arrays.asList( | |
| new Image(1, "Treehouse of Horror V", "https://www.imdb.com/title/tt0096697/mediaviewer/rm3842005760"), | |
| new Image(2, "The Town", "https://www.imdb.com/title/tt0096697/mediaviewer/rm3698134272"), | |
| new Image(3, "The Last Traction Hero", "https://www.imdb.com/title/tt0096697/mediaviewer/rm1445594112")); | |
| return images; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment