diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index b1a32d9ec88a43ac67e8ca337f0af7bc540c378d..8440bb3ac24565aae6d7b9059fff4bb645862db1 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -20,6 +20,7 @@ dependencies { implementation("io.micronaut.crac:micronaut-crac") implementation("jakarta.annotation:jakarta.annotation-api") implementation("io.micronaut.aws:micronaut-function-aws-api-proxy") + implementation("io.micronaut:micronaut-http-server-netty") runtimeOnly("ch.qos.logback:logback-classic") // Swagger diff --git a/nshms.yml b/nshms.yml index f60efbace57bf38edc4c23e2eead30dbda8b31e0..2d794b6cd2c3b47bfcde7d55d126dfffe89a1751 100644 --- a/nshms.yml +++ b/nshms.yml @@ -1,6 +1,33 @@ #### # NSHMs to use for unit tests and for deployments. +# +# Example with mixed deployment: +# +# repo: 'nshm-conus' +# tag: '6.1.0' +# year: 2023 +# deployment: +# baseHref: '/ws/nshmp/conus-2023/dynamic' +# environments: +# development: +# type: 'LAMBDA' +# staging: +# type: 'LAMBDA' +# production: +# type: 'EC2' +# cpu: 8 +# memory: 32 +# min: 1 +# max: 3 +# label: '2023 Conterminous U.S. Dynamic Services' +# model: 'CONUS_2023' +# test: +# site: +# latitude: 37.75 +# longitude: -122.4 +# treeId: 3199 #### + nshms: # Alaska 2007 NSHM - @@ -9,11 +36,13 @@ nshms: year: 2007 deployment: baseHref: '/ws/nshmp/alaska-2007/dynamic' - type: 'LAMBDA' environments: - - 'development' - - 'staging' - # - production + development: + type: 'LAMBDA' + staging: + type: 'LAMBDA' + # production: + # type: 'LAMBDA' label: '2007 Alaska Dynamic Services' model: 'ALASKA_2007' test: @@ -29,11 +58,13 @@ nshms: year: 2023 deployment: baseHref: '/ws/nshmp/alaska-2023/dynamic' - type: 'LAMBDA' environments: - - 'development' - - 'staging' - - 'production' + development: + type: 'LAMBDA' + staging: + type: 'LAMBDA' + production: + type: 'LAMBDA' label: '2023 Alaska Dynamic Services (beta)' model: 'ALASKA_2023' test: @@ -49,11 +80,13 @@ nshms: year: 2018 deployment: baseHref: '/ws/nshmp/conus-2018/dynamic' - type: 'LAMBDA' environments: - - 'development' - - 'staging' - - 'production' + development: + type: 'LAMBDA' + staging: + type: 'LAMBDA' + production: + type: 'LAMBDA' label: '2018 Conterminous U.S. Dynamic Services' model: 'CONUS_2018' test: @@ -69,11 +102,13 @@ nshms: year: 2023 deployment: baseHref: '/ws/nshmp/conus-2023/dynamic' - type: 'LAMBDA' environments: - - 'development' - - 'staging' - - 'production' + development: + type: 'LAMBDA' + staging: + type: 'LAMBDA' + production: + type: 'LAMBDA' label: '2023 Conterminous U.S. Dynamic Services' model: 'CONUS_2023' test: @@ -89,11 +124,13 @@ nshms: year: 2021 deployment: baseHref: '/ws/nshmp/hawaii-2021/dynamic' - type: 'LAMBDA' environments: - - 'development' - - 'staging' - - 'production' + development: + type: 'LAMBDA' + staging: + type: 'LAMBDA' + production: + type: 'LAMBDA' label: '2021 Hawaii Dynamic Services' model: 'HAWAII_2021' test: @@ -109,11 +146,13 @@ nshms: year: 2025 deployment: baseHref: '/ws/nshmp/prvi-2025/dynamic' - type: 'LAMBDA' environments: - - 'development' - - 'staging' - # - production: + development: + type: 'LAMBDA' + staging: + type: 'LAMBDA' + production: + type: 'LAMBDA' label: '2025 PRVI Dynamic Services' model: 'PRVI_2025' test: @@ -121,4 +160,3 @@ nshms: latitude: 18.47 longitude: -66.12 treeId: 7400 - diff --git a/src/main/java/gov/usgs/earthquake/nshmp/www/SwaggerUIController.java b/src/main/java/gov/usgs/earthquake/nshmp/www/SwaggerUIController.java index d18a7ff4e6ced31aba7e4df911a4d12513869713..6712f92910e9f5b666b386c6445f7df4b5f65bdc 100644 --- a/src/main/java/gov/usgs/earthquake/nshmp/www/SwaggerUIController.java +++ b/src/main/java/gov/usgs/earthquake/nshmp/www/SwaggerUIController.java @@ -1,7 +1,7 @@ package gov.usgs.earthquake.nshmp.www; -import java.io.BufferedInputStream; import java.io.IOException; +import java.io.InputStream; import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.Optional; @@ -114,7 +114,7 @@ public class SwaggerUIController { Optional<URL> resource = loader.getResource(path); return IOUtils.toString( - (BufferedInputStream) resource.orElseThrow().getContent(), + (InputStream) resource.orElseThrow().getContent(), StandardCharsets.UTF_8); } }