Coder Social home page Coder Social logo

spring-cloud-gateway's Introduction

spring-cloud-gateway

image

gradle 의존성 추가

    // https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-netflix-eureka-client
    implementation("org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:3.1.0")
    // https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-gateway
    implementation("org.springframework.cloud:spring-cloud-starter-gateway:3.1.0")

yml

server:
  port: 7777

eureka:
  client:
    fetch-registry: true
    register-with-eureka: true
    service-url:
      defaultZone: http://localhost:9999/eureka # eureka port

spring:
  application:
    name: gateway-service
  cloud:
    gateway:
      routes:
        - id: test
#          uri: http://localhost:10000 # http://localhost:8000/test -> http://localhost:10000
          uri: lb://MSA # eureka 등록된 이름 사용시
          predicates:
            - Path=/test/** #  /test/**
#       - id: temp #여러개 사용시
#         uri: http://localhost:10001 # http://localhost:8000/temp -> http://localhost:10000
#         uri: lb://MSA2 # eureka 등록된 이름 사용시
#         predicates:
#           - Path=/temp/** #  /temp/**    

curl 테스트

curl -X GET --location "http://localhost:7777/test"

spring-cloud-gateway's People

Contributors

hanbong5938 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.