ashur
ashur

Reputation: 4337

Serving static content in microservice architecture

I'm building web application in microservice architecture and we decided to build it on top of Spring Boot with Spring Cloud and deployment on AWS on Docker containers with S3 as image storage and RDS for data.

My current concern is regarding serving a static content such as HTML, JS.

In microservices the popular solution is to use API Gateway as a single point of entry, so how I should serve mentioned files? In the beginning I thought that having NGINX in front would be helpful so it'd load balance, route to all services and serve static content. But if we choose to use Spring Cloud Gateway instead of NGINX as a gateway, then how to serve? Beside the fact NGINX and Spring Gateway have the same purpose the NGINX is more than simply a gateway, as far as I understand this.

Upvotes: 3

Views: 1398

Answers (1)

Joshua Fox
Joshua Fox

Reputation: 19695

You could simply serve files direct from S3 so long as your webapp is built so that cross-domain issues do not affect Javascript. (Enabling CORS in S3 can help.)

Upvotes: 1

Related Questions