Given the following configuration in application.yml, I would expect to be able to serve files from both of the following paths:
However, only the first path works. The second returns a 200 status code with the following in the response body: {"message":"Page Not Found","_links":{"self":{"href":"/static/folder/image.png","templated":false}}}
The issue seems to be the extra subdirectory, but I would have expected the **/* in the mapping field to allow for subdirectories. FWIW, I get the same error if I request a resource that does not exist.
This is on Micronaut 2.
micronaut:
application:
name: api
router:
static-resources:
default:
paths: file:/root/static
mapping: /static/**/*
enabled: true
The paths key should be a list (as hinted by the plural):
router:
static-resources:
default:
paths:
- file:/root/static
mapping: /static/**/*
enabled: true