#297 Create Spring Boot-backed Image microservice with an endpoint to retrieve an image path
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
@ -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";
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
server.port=50005
|
Reference in New Issue
Block a user