gpt4 book ai didi

gruntjs - 使用grunt-contrib-connect-具有添加的上下文路径的打开页面URL

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

我已经建立了 Grunt 的连接,像这样:

connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost'
},
livereload: {
options: {
open: true,
base: [
'app'
]
}
}
}

效果很好-将我的index.html页面加载为:
http://localhost:9000

但是,为了使它与在生产环境中加载方式保持一致,我希望它在添加了其他上下文路径的情况下进行加载,例如:
http://localhost:9000/myappcontext/secured

可以简单地通过grunt-contrib-connect来完成吗?还是我需要添加其他代理/中间件?

任何人都有这种设置的简单示例吗?

最佳答案

是的,您可以轻松完成此操作,只需配置open选项:

connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost'
},
livereload: {
options: {
open: {
target: 'http://localhost:9000/myappcontext/secured'
},
base: [
'app'
]
}
}
}

You can consult the README for more information about the available options.

关于gruntjs - 使用grunt-contrib-connect-具有添加的上下文路径的打开页面URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21400675/

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