From b50f01b7f9a9dbcf6c7859a05014d8d7bb92407a Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 23 Apr 2024 01:15:24 +0100 Subject: [PATCH] update port --- Dockerfile | 6 +++--- src/main/java/cc/fascinated/{ => backend}/Main.java | 2 +- .../java/cc/fascinated/{ => backend}/common/IPUtils.java | 2 +- .../{ => backend}/controller/PasteController.java | 6 +++--- .../exception/ExceptionControllerAdvice.java | 4 ++-- .../{ => backend}/exception/impl/BadRequestException.java | 2 +- .../exception/impl/ResourceNotFoundException.java | 2 +- .../fascinated/{ => backend}/log/TransactionLogger.java | 4 ++-- .../java/cc/fascinated/{ => backend}/model/Paste.java | 2 +- .../{ => backend}/model/response/ErrorResponse.java | 2 +- .../{ => backend}/repository/PasteRepository.java | 4 ++-- .../cc/fascinated/{ => backend}/service/PasteService.java | 8 ++++---- src/main/resources/application.yml | 2 +- .../cc/fascinated/{ => backend}/PasteControllerTests.java | 4 ++-- 14 files changed, 25 insertions(+), 25 deletions(-) rename src/main/java/cc/fascinated/{ => backend}/Main.java (97%) rename src/main/java/cc/fascinated/{ => backend}/common/IPUtils.java (96%) rename src/main/java/cc/fascinated/{ => backend}/controller/PasteController.java (88%) rename src/main/java/cc/fascinated/{ => backend}/exception/ExceptionControllerAdvice.java (94%) rename src/main/java/cc/fascinated/{ => backend}/exception/impl/BadRequestException.java (86%) rename src/main/java/cc/fascinated/{ => backend}/exception/impl/ResourceNotFoundException.java (85%) rename src/main/java/cc/fascinated/{ => backend}/log/TransactionLogger.java (96%) rename src/main/java/cc/fascinated/{ => backend}/model/Paste.java (91%) rename src/main/java/cc/fascinated/{ => backend}/model/response/ErrorResponse.java (94%) rename src/main/java/cc/fascinated/{ => backend}/repository/PasteRepository.java (69%) rename src/main/java/cc/fascinated/{ => backend}/service/PasteService.java (87%) rename src/test/java/cc/fascinated/{ => backend}/PasteControllerTests.java (94%) diff --git a/Dockerfile b/Dockerfile index 985229a..18b73a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,9 +9,9 @@ COPY . . # Build the jar RUN mvn package -q -Dmaven.test.skip -DskipTests -T2C -# Make port 80 available to the world outside this container -EXPOSE 80 -ENV PORT=80 +# Make port 3000 available to the world outside this container +EXPOSE 3000 +ENV PORT=3000 # Run the jar file CMD java -jar target/Paste-Backend.jar -Djava.awt.headless=true \ No newline at end of file diff --git a/src/main/java/cc/fascinated/Main.java b/src/main/java/cc/fascinated/backend/Main.java similarity index 97% rename from src/main/java/cc/fascinated/Main.java rename to src/main/java/cc/fascinated/backend/Main.java index 191db4a..d27afe3 100644 --- a/src/main/java/cc/fascinated/Main.java +++ b/src/main/java/cc/fascinated/backend/Main.java @@ -1,4 +1,4 @@ -package cc.fascinated; +package cc.fascinated.backend; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/src/main/java/cc/fascinated/common/IPUtils.java b/src/main/java/cc/fascinated/backend/common/IPUtils.java similarity index 96% rename from src/main/java/cc/fascinated/common/IPUtils.java rename to src/main/java/cc/fascinated/backend/common/IPUtils.java index eed9631..303c45d 100644 --- a/src/main/java/cc/fascinated/common/IPUtils.java +++ b/src/main/java/cc/fascinated/backend/common/IPUtils.java @@ -1,4 +1,4 @@ -package cc.fascinated.common; +package cc.fascinated.backend.common; import jakarta.servlet.http.HttpServletRequest; import lombok.experimental.UtilityClass; diff --git a/src/main/java/cc/fascinated/controller/PasteController.java b/src/main/java/cc/fascinated/backend/controller/PasteController.java similarity index 88% rename from src/main/java/cc/fascinated/controller/PasteController.java rename to src/main/java/cc/fascinated/backend/controller/PasteController.java index 50f45b0..00eedc4 100644 --- a/src/main/java/cc/fascinated/controller/PasteController.java +++ b/src/main/java/cc/fascinated/backend/controller/PasteController.java @@ -1,7 +1,7 @@ -package cc.fascinated.controller; +package cc.fascinated.backend.controller; -import cc.fascinated.model.Paste; -import cc.fascinated.service.PasteService; +import cc.fascinated.backend.model.Paste; +import cc.fascinated.backend.service.PasteService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; diff --git a/src/main/java/cc/fascinated/exception/ExceptionControllerAdvice.java b/src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java similarity index 94% rename from src/main/java/cc/fascinated/exception/ExceptionControllerAdvice.java rename to src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java index 74de241..5d9cc6e 100644 --- a/src/main/java/cc/fascinated/exception/ExceptionControllerAdvice.java +++ b/src/main/java/cc/fascinated/backend/exception/ExceptionControllerAdvice.java @@ -1,6 +1,6 @@ -package cc.fascinated.exception; +package cc.fascinated.backend.exception; -import cc.fascinated.model.response.ErrorResponse; +import cc.fascinated.backend.model.response.ErrorResponse; import io.micrometer.common.lang.NonNull; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; diff --git a/src/main/java/cc/fascinated/exception/impl/BadRequestException.java b/src/main/java/cc/fascinated/backend/exception/impl/BadRequestException.java similarity index 86% rename from src/main/java/cc/fascinated/exception/impl/BadRequestException.java rename to src/main/java/cc/fascinated/backend/exception/impl/BadRequestException.java index 9d96eb2..c6b12a3 100644 --- a/src/main/java/cc/fascinated/exception/impl/BadRequestException.java +++ b/src/main/java/cc/fascinated/backend/exception/impl/BadRequestException.java @@ -1,4 +1,4 @@ -package cc.fascinated.exception.impl; +package cc.fascinated.backend.exception.impl; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; diff --git a/src/main/java/cc/fascinated/exception/impl/ResourceNotFoundException.java b/src/main/java/cc/fascinated/backend/exception/impl/ResourceNotFoundException.java similarity index 85% rename from src/main/java/cc/fascinated/exception/impl/ResourceNotFoundException.java rename to src/main/java/cc/fascinated/backend/exception/impl/ResourceNotFoundException.java index a4f0003..09a19a1 100644 --- a/src/main/java/cc/fascinated/exception/impl/ResourceNotFoundException.java +++ b/src/main/java/cc/fascinated/backend/exception/impl/ResourceNotFoundException.java @@ -1,4 +1,4 @@ -package cc.fascinated.exception.impl; +package cc.fascinated.backend.exception.impl; import lombok.experimental.StandardException; import org.springframework.http.HttpStatus; diff --git a/src/main/java/cc/fascinated/log/TransactionLogger.java b/src/main/java/cc/fascinated/backend/log/TransactionLogger.java similarity index 96% rename from src/main/java/cc/fascinated/log/TransactionLogger.java rename to src/main/java/cc/fascinated/backend/log/TransactionLogger.java index 35765b2..08297ec 100644 --- a/src/main/java/cc/fascinated/log/TransactionLogger.java +++ b/src/main/java/cc/fascinated/backend/log/TransactionLogger.java @@ -1,6 +1,6 @@ -package cc.fascinated.log; +package cc.fascinated.backend.log; -import cc.fascinated.common.IPUtils; +import cc.fascinated.backend.common.IPUtils; import jakarta.servlet.http.HttpServletRequest; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/cc/fascinated/model/Paste.java b/src/main/java/cc/fascinated/backend/model/Paste.java similarity index 91% rename from src/main/java/cc/fascinated/model/Paste.java rename to src/main/java/cc/fascinated/backend/model/Paste.java index 4ba7e5e..9bf2699 100644 --- a/src/main/java/cc/fascinated/model/Paste.java +++ b/src/main/java/cc/fascinated/backend/model/Paste.java @@ -1,4 +1,4 @@ -package cc.fascinated.model; +package cc.fascinated.backend.model; import io.micrometer.common.lang.NonNull; import lombok.AllArgsConstructor; diff --git a/src/main/java/cc/fascinated/model/response/ErrorResponse.java b/src/main/java/cc/fascinated/backend/model/response/ErrorResponse.java similarity index 94% rename from src/main/java/cc/fascinated/model/response/ErrorResponse.java rename to src/main/java/cc/fascinated/backend/model/response/ErrorResponse.java index 39fa0b7..8047fc1 100644 --- a/src/main/java/cc/fascinated/model/response/ErrorResponse.java +++ b/src/main/java/cc/fascinated/backend/model/response/ErrorResponse.java @@ -1,4 +1,4 @@ -package cc.fascinated.model.response; +package cc.fascinated.backend.model.response; import io.micrometer.common.lang.NonNull; import lombok.EqualsAndHashCode; diff --git a/src/main/java/cc/fascinated/repository/PasteRepository.java b/src/main/java/cc/fascinated/backend/repository/PasteRepository.java similarity index 69% rename from src/main/java/cc/fascinated/repository/PasteRepository.java rename to src/main/java/cc/fascinated/backend/repository/PasteRepository.java index fd8afe9..de0620d 100644 --- a/src/main/java/cc/fascinated/repository/PasteRepository.java +++ b/src/main/java/cc/fascinated/backend/repository/PasteRepository.java @@ -1,6 +1,6 @@ -package cc.fascinated.repository; +package cc.fascinated.backend.repository; -import cc.fascinated.model.Paste; +import cc.fascinated.backend.model.Paste; import org.springframework.data.mongodb.repository.MongoRepository; /** diff --git a/src/main/java/cc/fascinated/service/PasteService.java b/src/main/java/cc/fascinated/backend/service/PasteService.java similarity index 87% rename from src/main/java/cc/fascinated/service/PasteService.java rename to src/main/java/cc/fascinated/backend/service/PasteService.java index b0d37ec..9eae771 100644 --- a/src/main/java/cc/fascinated/service/PasteService.java +++ b/src/main/java/cc/fascinated/backend/service/PasteService.java @@ -1,8 +1,8 @@ -package cc.fascinated.service; +package cc.fascinated.backend.service; -import cc.fascinated.exception.impl.ResourceNotFoundException; -import cc.fascinated.model.Paste; -import cc.fascinated.repository.PasteRepository; +import cc.fascinated.backend.model.Paste; +import cc.fascinated.backend.exception.impl.ResourceNotFoundException; +import cc.fascinated.backend.repository.PasteRepository; import org.apache.commons.lang3.RandomStringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 70c2492..b1d1d56 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,6 +1,6 @@ server: address: 0.0.0.0 - port: 80 + port: 3000 servlet: context-path: / diff --git a/src/test/java/cc/fascinated/PasteControllerTests.java b/src/test/java/cc/fascinated/backend/PasteControllerTests.java similarity index 94% rename from src/test/java/cc/fascinated/PasteControllerTests.java rename to src/test/java/cc/fascinated/backend/PasteControllerTests.java index a65a1eb..f2e31e5 100644 --- a/src/test/java/cc/fascinated/PasteControllerTests.java +++ b/src/test/java/cc/fascinated/backend/PasteControllerTests.java @@ -1,4 +1,4 @@ -package cc.fascinated; +package cc.fascinated.backend; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -13,7 +13,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @SpringBootTest @AutoConfigureMockMvc -class MojangControllerTests { +class PasteControllerTests { @Autowired private MockMvc mockMvc;