Add configurable base path for web resources
This commit is contained in:
@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
@@ -40,6 +41,7 @@ import reactor.core.publisher.Flux;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@ConditionalOnClass(RestController.class)
|
@ConditionalOnClass(RestController.class)
|
||||||
|
@RequestMapping("${spring.cloud.function.web.path:}")
|
||||||
public class FunctionController {
|
public class FunctionController {
|
||||||
|
|
||||||
@Value("${debug:${DEBUG:false}}")
|
@Value("${debug:${DEBUG:false}}")
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class FluxResponseBodyEmitter<T> extends ResponseBodyEmitter {
|
|||||||
private final MediaType mediaType;
|
private final MediaType mediaType;
|
||||||
|
|
||||||
public FluxResponseBodyEmitter(Flux<T> observable) {
|
public FluxResponseBodyEmitter(Flux<T> observable) {
|
||||||
this(null, null, observable);
|
this(1000L, null, observable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FluxResponseBodyEmitter(Long timeout, MediaType mediaType,
|
public FluxResponseBodyEmitter(Long timeout, MediaType mediaType,
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{"properties": [
|
||||||
|
{
|
||||||
|
"name": "spring.cloud.function.web.path",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "Path to web resources for functions (should start with / if not empty).",
|
||||||
|
"defaultValue": ""
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user