gpt4 book ai didi

grails - 无法访问 Grails 3 中的 web-app 文件夹文件

转载 作者:行者123 更新时间:2023-12-04 18:03:24 26 4
gpt4 key购买 nike

我无法访问 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com