当我运行grails运行应用程序时,我只想提供html页面,包括它们链接的.css和.js(有角度和jQuery的内容).
我想检查我的http呼叫是否在双方正确使用 – 无需部署.war并配置数据库.
afaik grails run-app只是启动一个jetty / tomcat – 这两个都可以显着地提供.html页面.我需要做什么来使grails开发工具部署我的文件?
我需要发出http请求,
所以使用不同的服务器会违反JS-SOP,
而部署.war会大大减缓开发过程
我迄今为止只发现了笨重的jsonp,代理,.war部署解决方案或者解决方案
我尝试将文件放在项目的结构(/ src / main,/ src / main / resources,/ src / main / public,资产文件夹及其子文件夹)中,在每个子目录中创建了Web应用程序目录,Init,domain,conf目录 – 你命名)
然后将其添加到urlmappings.groovy中:
"/"(redirect:"/index.html")
对于grails> = 3.0.12
Location of static resources
In order to resolve an issue around how POST requests are treated for
REST applications on non-existent resources,static resources located
in src/main/resources/public are Now resolved under the /static/** URI
by default,instead of the base URI /**. If you wish to restore the
prevIoUs behavIoUr add the following configuration:grails.resources.pattern = ‘/**’
原文地址:https://www.jb51.cc/angularjs/140813.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。