Search code examples
spring-bootnetflix-zuul

Use zuul to deliver static content


I have a Zuul reverse proxy in front of my spring boot microservices, used as an API gateway.

Can the Zuul spring boot app be used to deliver static content, IE client code that calls the API gateway? I dont want to host this in a microservices or have another VM to manage for hosting content

I tried having a static folder in resources folder, but cant figure out how to map this in the application.yml responsible for routing. I dont want to route it to a NGnix or apache server, but use the embedded Tomcat of Zuul Spring boot app.

What would be the route to put in the route config, or what is the best approach for this.

Thank you


Solution

  • You don't have to map it in the routes config. Whatever you put in the resources/static folder will be served, as long nothing else is mapped on the same path.