Added angular app serve and sample api routes
This commit is contained in:
parent
d68c89c6a3
commit
b34d072a9c
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,6 +4,7 @@ build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
/src/main/resources/static/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
|
@ -22,7 +22,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
developmentOnly 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-mail'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
|
14
src/main/java/de/w665/sharepulse/config/MvcConfig.java
Normal file
14
src/main/java/de/w665/sharepulse/config/MvcConfig.java
Normal file
@ -0,0 +1,14 @@
|
||||
package de.w665.sharepulse.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class MvcConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addViewControllers(ViewControllerRegistry registry) {
|
||||
registry.addViewController("/home").setViewName("forward:/index.html");
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package de.w665.sharepulse.rest;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1")
|
||||
public abstract class ApiRestController {
|
||||
}
|
14
src/main/java/de/w665/sharepulse/rest/TestRestResource.java
Normal file
14
src/main/java/de/w665/sharepulse/rest/TestRestResource.java
Normal file
@ -0,0 +1,14 @@
|
||||
package de.w665.sharepulse.rest;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class TestRestResource extends ApiRestController {
|
||||
|
||||
@GetMapping("test")
|
||||
public String test() {
|
||||
return "Test";
|
||||
}
|
||||
}
|
15
src/main/java/de/w665/sharepulse/rest/mappings/Upload.java
Normal file
15
src/main/java/de/w665/sharepulse/rest/mappings/Upload.java
Normal file
@ -0,0 +1,15 @@
|
||||
package de.w665.sharepulse.rest.mappings;
|
||||
|
||||
import de.w665.sharepulse.rest.ApiRestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class Upload extends ApiRestController {
|
||||
|
||||
// Currently testing
|
||||
@GetMapping("/upload")
|
||||
public String getUpload() {
|
||||
return "Upload works";
|
||||
}
|
||||
}
|
@ -1 +1,5 @@
|
||||
# Static path
|
||||
spring.web.resources.static-locations=classpath:/static/browser/
|
||||
|
||||
# Rest API path prefix
|
||||
spring.data.rest.base-path=/api/v1
|
Loading…
x
Reference in New Issue
Block a user