├── src └── main │ ├── resources │ └── application.properties │ └── java │ └── com │ └── laptrinhjavaweb │ └── api │ ├── Application.java │ └── HomeAPI.java ├── .gitignore └── pom.xml /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8081 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .settings 2 | target 3 | *.classpath 4 | *.project 5 | -------------------------------------------------------------------------------- /src/main/java/com/laptrinhjavaweb/api/Application.java: -------------------------------------------------------------------------------- 1 | package com.laptrinhjavaweb.api; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | @SpringBootApplication 7 | public class Application { 8 | 9 | public static void main(String[] args) { 10 | SpringApplication.run(Application.class, args); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/laptrinhjavaweb/api/HomeAPI.java: -------------------------------------------------------------------------------- 1 | package com.laptrinhjavaweb.api; 2 | 3 | import org.springframework.http.ResponseEntity; 4 | import org.springframework.web.bind.annotation.GetMapping; 5 | import org.springframework.web.bind.annotation.RestController; 6 | 7 | @RestController 8 | public class HomeAPI { 9 | 10 | @GetMapping("/api/test") 11 | public ResponseEntity testSpringBoot() { 12 | return ResponseEntity.ok("Success"); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | com.laptrinhjavaweb 6 | spring-boot 7 | 1.0 8 | 9 | 10 | org.springframework.boot 11 | spring-boot-starter-parent 12 | 1.5.9.RELEASE 13 | 14 | 15 | 16 | 1.8 17 | 18 | 19 | 20 | 21 | 22 | org.springframework.boot 23 | spring-boot-starter-web 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-maven-plugin 33 | 34 | 35 | 36 | --------------------------------------------------------------------------------