乐闻世界logo
搜索文章和话题

What is the purpose of the public folder in Next.js?

2024年7月15日 23:21

In Next.js, the public folder is used to store static assets such as images, CSS files, scripts, or other static resources. These files can be directly accessed via URLs relative to the project root directory. For example, if you place an image named logo.png in the public folder, you can access it directly in the browser using http://<your-site-url>/logo.png. This design makes managing and referencing static assets highly convenient, without requiring specific server routes to handle these files.

标签:React