Cloud Studio工作台URL映射关系
比如你使用Intellij中的Spring Initializr构建了一个Spring Boot web项目,并且有这样一个Controller:
@RestController
public class HelloController {
@RequestMapping("/hello")
public String index() {
return "Hello World";
}
}
当你把该项目部署在本地时,访问该服务的请求地址为http://localhost:8080/hello
;当你把该项目部署在Cloud Studio工作台启动时,要想访问到该服务,需要先在工作台右侧打开访问链接面板,点击创建链接按钮,会生成映射到http://localhost:8080链接(如https://dsiisv-8080-glzzwx.dev.ide.live
),在映射链接后追加/hello
得到https://dsiisv-8080-glzzwx.dev.ide.live/hello
,在浏览器中打开该地址就可以访问到你部署在Cloud Studio的服务了。如图