Skip to content

Commit

Permalink
fix: set env and port (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
g-otn authored Jan 29, 2024
2 parents 916f07b + 2fee061 commit b1725d8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
</dependencies>

<build>
<finalName>app</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
package br.com.grupo63.serviceorder;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
import io.swagger.v3.oas.annotations.info.Info;
import io.swagger.v3.oas.annotations.security.SecurityScheme;
import io.swagger.v3.oas.annotations.servers.Server;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;

@OpenAPIDefinition(
info = @Info(title = "${info.name}", description = "${info.description}", version = "${info.version}"),
servers ={
@Server(url = "${server.servlet.context-path:}", description = "Current URL"),
@Server(url = "localhost:${server.port:8080}${server.servlet.context-path:}", description = "Localhost"),
@Server(url = "${app.docs-api-url:(no value)}${server.servlet.context-path:}", description = "Custom URL from env")
})
@SecurityScheme(
name = "bearerAuth",
type = SecuritySchemeType.HTTP,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import java.util.Optional;

@FeignClient(name = "identification", url = "${urls.baseurl-identification}")
@FeignClient(name = "identification", url = "${app.api-url.identification}")
public interface IIdentificationGateway {

@RequestMapping(method = RequestMethod.GET, value = "/identification/clients/{id}")
Expand Down
10 changes: 2 additions & 8 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ jwt:
key:
public: "${JWT_PUBLIC_KEY:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqStd8n4SGNM0eZhV/hzU+urHA5/IMZPoP9YQ9ZcLKWiX33nI6bSuZMCrLZcJExf63xS+uxDpGxM8Mnk2zOdl+lPwANXLzP1us5P1PyA3YPycW9J7C5YTQW0GiEL3M93ZX7vMJiVoBYblP3JPlYnoYlBORuc0JPk33KtfEZP+78qXpPHM8imYrJLe8ceiDLLFDU/nh5KC2dWAy3ci1ahoJ1Q9ELhp3IZLvOTX57H/T2VKOYOya5+ST41h+JjzI+qGTVnLcKaW+k25YLlVnkSspvdx98+yQDi7kbOTS6yRZHUPD6wPk/nUozpD0nZKccoH4W+zMwmQVtsAA6JCA9gfGwIDAQAB}"

urls:
baseurl-identification: "${BASE_URL_IDENTIFICATION:localhost:8081}"

server:
servlet:
context-path: "/order"
# --- Custom keys ---

app:
docs-api-url: "${DOCS_API_URL:(no value)}"
api-url:
identification: ${API_URL_IDENTIFICATION:http\://localhost\:8081}
identification: "${API_URL_IDENTIFICATION:http://localhost:8001}"
7 changes: 6 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,17 @@ management:
exposure:
include: health, info, metrics, shutdown

server:
servlet:
context-path: "/order"
port: 8002

# --- Custom keys ---

app:
docs-api-url: "${DOCS_API_URL:(no value)}"
api-url:
identification: ${API_URL_IDENTIFICATION}
identification: "${API_URL_IDENTIFICATION}"

info:
name: "@project.name@"
Expand Down

0 comments on commit b1725d8

Please sign in to comment.