Sage-Bionetworks / sage-monorepo

Where OpenChallenges, Schematic, and other Sage open source apps are built
https://sage-bionetworks.github.io/sage-monorepo/
Apache License 2.0
23 stars 12 forks source link

Create Challenge API Gateway #241

Closed tschaffter closed 2 years ago

tschaffter commented 2 years ago

Follow these two articles to setup the API gateway for the challenge stack.

  1. Microservices – Service Registration and Discovery With Spring Cloud Netflix Eureka
    • Describes how to setup an early API gateway, which will be updated in the second article
  2. Microservices – Setup API Gateway Using Spring Cloud Gateway
tschaffter commented 2 years ago

Generate Challenge API gateway

image

https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.7.0&packaging=jar&jvmVersion=17&groupId=org.sagebionetworks.challenge&artifactId=challenge-api-gateway&name=challenge-api-gateway&description=&packageName=org.sagebionetworks.challenge&dependencies=cloud-eureka,actuator,cloud-gateway

Generate the project before importing the project files generated with Spring Initializr.

$ nx g @nxrocks/nx-spring-boot:new challenge-api-gateway     
✔ What kind of project are you generating? · application
✔ Which build system would you like to use? · maven-project
✔ Which packaging would you like to use? · jar
✔ Which version of Java would you like to use? · 17
✔ Which language would you like to use? · java
✔ What groupId would you like to use? · org.sagebionetworks.challenge
✔ What artifactId would you like to use? · challenge-api-gateway
✔ What package name would you like to use? · org.sagebionetworks.challenge
✔ What is the project about? · 
✔ What dependencies would you like to use (comma separated)?
👉 Go to https://start.spring.io/dependencies to get the ids needed here · 
Downloading Spring Boot project zip from : https://start.spring.io/starter.zip?type=maven-project&language=java&name=challenge-api-gateway&groupId=org.sagebionetworks.challenge&artifactId=challenge-api-gateway&packageName=org.sagebionetworks.challenge&javaVersion=17&packaging=jar...
Extracting Spring Boot project zip to '/workspaces/challenge-registry/apps/challenge-api-gateway'...
CREATE apps/challenge-api-gateway/project.json
UPDATE workspace.json
CREATE apps/challenge-api-gateway/.mvn/wrapper/maven-wrapper.jar
CREATE apps/challenge-api-gateway/.mvn/wrapper/maven-wrapper.properties
CREATE apps/challenge-api-gateway/src/test/java/org/sagebionetworks/challenge/ChallengeApiGatewayApplicationTests.java
CREATE apps/challenge-api-gateway/src/main/java/org/sagebionetworks/challenge/ChallengeApiGatewayApplication.java
CREATE apps/challenge-api-gateway/src/main/resources/application.properties
CREATE apps/challenge-api-gateway/mvnw.cmd
CREATE apps/challenge-api-gateway/HELP.md
CREATE apps/challenge-api-gateway/.gitignore
CREATE apps/challenge-api-gateway/mvnw
CREATE apps/challenge-api-gateway/pom.xml