From af67c7a9fd8d8c8d4d098c67c83384d6e36a4d9e Mon Sep 17 00:00:00 2001 From: Julian Horner <julianhorner@web.de> Date: Mon, 16 Dec 2019 18:37:51 +0100 Subject: [PATCH] Add configuration for zuul server --- pom.xml | 69 ++++++++++++++++++++++++++++++ src/main/resources/application.yml | 29 +++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 pom.xml create mode 100644 src/main/resources/application.yml diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..38864d7 --- /dev/null +++ b/pom.xml @@ -0,0 +1,69 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>de.rtuni.ms.apig</groupId> + <artifactId>api-gateway</artifactId> + <version>1.0.0</version> + <packaging>war</packaging> + + <parent> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-parent</artifactId> + <version>2.0.0.RELEASE</version> + </parent> + + <dependencies> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-starter-netflix-zuul</artifactId> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-tomcat</artifactId> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-devtools</artifactId> + <optional>true</optional> + </dependency> + </dependencies> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-dependencies</artifactId> + <version>Finchley.RELEASE</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <build> + <plugins> + <plugin> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-maven-plugin</artifactId> + <configuration> + <mainClass>de.rtuni.ms.apig.Application</mainClass> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..761fb9c --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,29 @@ +# Spring properties +spring: + application: + name: api-gateway # Identify this application + main: + allow-bean-definition-overriding: true + +# HTTP Server +server: + port: 2222 # HTTP (Tomcat) port + +# Discovery Server Access +# 1. DEV ONLY: Reduce the lease renewal interval to speed up registration +# 2. Define URL of registration server (defaultZone) +eureka: + client: + serviceUrl: + defaultZone: http://localhost:8761/eureka/ + +zuul: + ignored-services: "*" + routes: + dummy-service: + path: /** # The part that has to be appended if a specific call is made + service-id: dummy-service + auth-service: + path: /auth/** + service-id: AUTH-SERVICE # can we write this lowercase? + -- GitLab