Skip to content

Commit b1725d8

Browse files
authored
fix: set env and port (#6)
2 parents 916f07b + 2fee061 commit b1725d8

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

pom.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
</dependencies>
120120

121121
<build>
122-
<finalName>app</finalName>
123122
<plugins>
124123
<plugin>
125124
<groupId>org.springframework.boot</groupId>

src/main/java/br/com/grupo63/serviceorder/ServiceOrderApplication.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
package br.com.grupo63.serviceorder;
22

3+
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
34
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
45
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
6+
import io.swagger.v3.oas.annotations.info.Info;
57
import io.swagger.v3.oas.annotations.security.SecurityScheme;
8+
import io.swagger.v3.oas.annotations.servers.Server;
69
import org.springframework.boot.SpringApplication;
710
import org.springframework.boot.autoconfigure.SpringBootApplication;
811
import org.springframework.cloud.openfeign.EnableFeignClients;
912

13+
@OpenAPIDefinition(
14+
info = @Info(title = "${info.name}", description = "${info.description}", version = "${info.version}"),
15+
servers ={
16+
@Server(url = "${server.servlet.context-path:}", description = "Current URL"),
17+
@Server(url = "localhost:${server.port:8080}${server.servlet.context-path:}", description = "Localhost"),
18+
@Server(url = "${app.docs-api-url:(no value)}${server.servlet.context-path:}", description = "Custom URL from env")
19+
})
1020
@SecurityScheme(
1121
name = "bearerAuth",
1222
type = SecuritySchemeType.HTTP,

src/main/java/br/com/grupo63/serviceorder/gateway/identification/IIdentificationGateway.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import java.util.Optional;
1010

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

1414
@RequestMapping(method = RequestMethod.GET, value = "/identification/clients/{id}")

src/main/resources/application-dev.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,8 @@ jwt:
2323
key:
2424
public: "${JWT_PUBLIC_KEY:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqStd8n4SGNM0eZhV/hzU+urHA5/IMZPoP9YQ9ZcLKWiX33nI6bSuZMCrLZcJExf63xS+uxDpGxM8Mnk2zOdl+lPwANXLzP1us5P1PyA3YPycW9J7C5YTQW0GiEL3M93ZX7vMJiVoBYblP3JPlYnoYlBORuc0JPk33KtfEZP+78qXpPHM8imYrJLe8ceiDLLFDU/nh5KC2dWAy3ci1ahoJ1Q9ELhp3IZLvOTX57H/T2VKOYOya5+ST41h+JjzI+qGTVnLcKaW+k25YLlVnkSspvdx98+yQDi7kbOTS6yRZHUPD6wPk/nUozpD0nZKccoH4W+zMwmQVtsAA6JCA9gfGwIDAQAB}"
2525

26-
urls:
27-
baseurl-identification: "${BASE_URL_IDENTIFICATION:localhost:8081}"
28-
29-
server:
30-
servlet:
31-
context-path: "/order"
26+
# --- Custom keys ---
3227

3328
app:
34-
docs-api-url: "${DOCS_API_URL:(no value)}"
3529
api-url:
36-
identification: ${API_URL_IDENTIFICATION:http\://localhost\:8081}
30+
identification: "${API_URL_IDENTIFICATION:http://localhost:8001}"

src/main/resources/application.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ management:
3838
exposure:
3939
include: health, info, metrics, shutdown
4040

41+
server:
42+
servlet:
43+
context-path: "/order"
44+
port: 8002
45+
4146
# --- Custom keys ---
4247

4348
app:
4449
docs-api-url: "${DOCS_API_URL:(no value)}"
4550
api-url:
46-
identification: ${API_URL_IDENTIFICATION}
51+
identification: "${API_URL_IDENTIFICATION}"
4752

4853
info:
4954
name: "@project.name@"

0 commit comments

Comments
 (0)