diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/IndexController.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/IndexController.java new file mode 100644 index 000000000..03da6c37d --- /dev/null +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/IndexController.java @@ -0,0 +1,18 @@ +package org.lowcoder.api.framework; + +import lombok.RequiredArgsConstructor; +import org.lowcoder.api.framework.view.ResponseView; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; +import reactor.core.publisher.Mono; + +@RequiredArgsConstructor +@RestController +public class IndexController { + + @GetMapping(value = "/", consumes = {MediaType.ALL_VALUE}) + public Mono> index() { + return Mono.just(ResponseView.error(ResponseView.SUCCESS, "Lowcoder API is up and runnig")); + } +} diff --git a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/security/SecurityConfig.java b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/security/SecurityConfig.java index d09c1a379..8d0c16f92 100644 --- a/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/security/SecurityConfig.java +++ b/server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/security/SecurityConfig.java @@ -120,6 +120,7 @@ SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.CONFIG_URL), ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.CONFIG_URL + "/deploymentId"), ServerWebExchangeMatchers.pathMatchers(HttpMethod.HEAD, NewUrl.STATE_URL + "/healthCheck"), + ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.PREFIX + "/status/**"), ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.APPLICATION_URL + "/*/view"), ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.APPLICATION_URL + "/*/view_marketplace"), ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, NewUrl.APPLICATION_URL + "/marketplace-apps"), // marketplace apps diff --git a/server/api-service/lowcoder-server/src/main/resources/application.yaml b/server/api-service/lowcoder-server/src/main/resources/application.yaml index 9277e9ce4..d852d8830 100644 --- a/server/api-service/lowcoder-server/src/main/resources/application.yaml +++ b/server/api-service/lowcoder-server/src/main/resources/application.yaml @@ -79,7 +79,7 @@ common: plugin-dirs: - ${LOWCODER_PLUGINS_DIR:../plugins} super-admin: - username: ${LOWCODER_SUPERUSER_USERNAME:test@lowcoder.org} + username: ${LOWCODER_SUPERUSER_USERNAME:admin@localhost} password: ${LOWCODER_SUPERUSER_PASSWORD:} marketplace: private-mode: ${LOWCODER_MARKETPLACE_PRIVATE_MODE:true} @@ -98,6 +98,27 @@ springdoc: paths-to-exclude: /api/v1/** management: + endpoints: + enabled-by-default: false + web: + base-path: "/api/status" + exposure: + include: "health,metrics,prometheus" + endpoint: + health: + show-details: never + show-components: always + enabled: true + metrics: + enabled: true + prometheus: + enabled: true health: mail: - enabled: false \ No newline at end of file + enabled: false + db: + enabled: true + redis: + enabled: true + diskspace: + enabled: false