Static file assets
While allowing for greater control of how the file should be sent to the client and who should be able to access it, doing this for all your static assets can get tedious.
Alternatively you can specify file assets that should be served by your Foxx service directly in the service manifest using the files
attribute:
"files": {
"/some/filename.png": {
"path": "some-local-filename.png",
"gzip": false
},
"/favicon.ico": "bookmark.ico",
}
Options
- path:
string
The relative path of the file or folder within the service.
- type:
string
(optional)
If set to true
the file will be served with gzip-encoding if supported by the client. This can be useful when serving text files like client-side JavaScript, CSS or HTML.
If a string is provided instead of an object, it will be interpreted as the path option.