#297 Create Spring Boot-backed Image microservice with an endpoint to retrieve an image path

This commit is contained in:
tmcconville
2016-04-02 18:19:21 -05:00
parent 3cbb88e09c
commit 0c6d3f2c3a
4 changed files with 112 additions and 0 deletions

View File

@ -0,0 +1,21 @@
package com.iluwatar.image.microservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
/**
* ImageApplication starts up Spring Boot, exposing endpoints for the Image microservice through
* the {@link ImageController}.
*/
@SpringBootApplication
public class ImageApplication {
/**
* Microservice entry point
* @param args
* command line args
*/
public static void main(String[] args) {
SpringApplication.run(ImageApplication.class, args);
}
}

View File

@ -0,0 +1,21 @@
package com.iluwatar.image.microservice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* Exposes the Image microservice's endpoints
*/
@RestController
public class ImageController {
/**
* An endpoint for a user to retrieve an image path
* @return An image path
*/
@RequestMapping(value = "/image-path", method = RequestMethod.GET)
public String getImagePath() {
return "/product-image.png";
}
}

View File

@ -0,0 +1 @@
server.port=50005