#297 Create Spring Boot-backed Price microservice with an endpoint to retrieve a price

This commit is contained in:
tmcconville
2016-04-02 18:19:42 -05:00
parent 0c6d3f2c3a
commit 01737bc643
4 changed files with 104 additions and 0 deletions

View File

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

View File

@ -0,0 +1,21 @@
package com.iluwatar.price.microservice;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
/**
* Exposes the Price microservice's endpoints
*/
@RestController
public class PriceController {
/**
* An endpoint for a user to retrieve a product's price
* @return A product's price
*/
@RequestMapping(value = "/price", method = RequestMethod.GET)
public String getPrice() {
return "20";
}
}

View File

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