Ste*_*eve 9 gruntjs grunt-contrib-connect
我已经设置了像这样的grunt连接:
connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost'
},
livereload: {
options: {
open: true,
base: [
'app'
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
效果很好 - 将我的index.html页面加载为:
http://localhost:9000
Run Code Online (Sandbox Code Playgroud)
但是,为了使其与生产中的加载方式保持一致,我希望它添加额外的上下文路径来加载它,例如:
http://localhost:9000/myappcontext/secured
Run Code Online (Sandbox Code Playgroud)
这可以通过grunt-contrib-connect简单地完成吗?或者我是否需要添加其他代理/中间件?
有人有这种类型设置的简单例子吗?
All*_*sen 10
是的,你可以毫不费力地做到这一点,只需配置open选项:
connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost'
},
livereload: {
options: {
open: {
target: 'http://localhost:9000/myappcontext/secured'
},
base: [
'app'
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10510 次 |
| 最近记录: |