我无法访问 Grails 3 中的 web-app 文件夹文件。
我有 robots.txt
在 web-app 文件夹和 Grails 2 中,我可以通过 http://localhost:8080/robots.txt
直接访问它。 .迁移到 Grails 3 后,我无法再访问它 http://localhost:8080/robots.txt
.
如何使这些文件再次可访问?
最佳答案
见 https://github.com/grails/grails-core/releases/tag/v3.0.12和部分 Location of static resources
在 Grails 3 中,您可以将文件存储在 src/main/resources 下。您可以通过以 static
开头的文件名访问它们。例如 http://localhost:8080/static/robots.txt
.
可以使用附加 URL 中定义的配置选项更改此路径
关于grails - 无法访问 Grails 3 中的 web-app 文件夹文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37808858/