strapi/docs/3.0.0-alpha.x/guides/public-assets.md

20 lines
908 B
Markdown
Raw Normal View History

2017-10-10 11:15:24 +02:00
# Public Assets
2017-10-10 11:15:24 +02:00
See the [public assets concepts](../concepts/concepts.md#public-assets) for details.
Because an API may need to serve static assets, every new Strapi project includes by default, a folder named `/public`. Any file located in this directory is accessible if the request's path doesn't match any other defined route and if it matches a public file name.
#### Example
An image named `company-logo.png` in `./public/` is accessible through `/company-logo.png` URL.
2019-11-07 12:05:39 +01:00
::: tip
`index.html` files are served if the request corresponds to a folder name (`/pictures` url will try to serve `public/pictures/index.html` file).
:::
2017-10-10 11:15:24 +02:00
::: warning
The dotfiles are not exposed. It means that every files with the names start by `.` such as `.htaccess` or `.gitignore` are not served.
:::
2017-10-10 11:15:24 +02:00
2019-07-05 03:05:36 +02:00
Refer to the [public assets configurations](../configurations/configurations.md#Application) for more information.