Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

本地启动后访问地址问题 #1163

Closed
2 of 3 tasks
whiteS18 opened this issue Mar 18, 2024 · 7 comments
Closed
2 of 3 tasks

本地启动后访问地址问题 #1163

whiteS18 opened this issue Mar 18, 2024 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@whiteS18
Copy link

whiteS18 commented Mar 18, 2024

Search before asking

  • I had searched in the issues and found no similar document issue.

Description

官方文档中快速上手的访问页面是127.0.0.1:8090/taier但是在常见问题里面最后一个空白页给的是127.0.0.1:8090,实际操作中访问路径不带/taier是可以正常访问的,带上/taier就会出现空白页404的提示

Documentation Links

https://dtstack.github.io/Taier/docs/quickstart/start#%E8%AE%BF%E9%97%AE%E9%A1%B5%E9%9D%A2

https://dtstack.github.io/Taier/docs/quickstart/faq#%E5%A6%82%E6%9E%9C%E8%AE%BF%E9%97%AE%E9%A1%B5%E9%9D%A2%E6%8F%90%E7%A4%BA%E7%A9%BA%E7%99%BD

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@Jixiangup
Copy link
Collaborator

你前后端分离启动的嘛?

@whiteS18
Copy link
Author

你前后端分离启动的嘛?

不是,只以debug模式启动了TaierApplication

@Jixiangup
Copy link
Collaborator

Jixiangup commented Mar 18, 2024

你前后端分离启动的嘛?

不是,只以debug模式启动了TaierApplication

因为在后面版本更新以后我们将路径重写了 你这个应该是吧前端资源移动到你的data-develop的resources下了对吧?

@whiteS18
Copy link
Author

你前后端分离启动的嘛?

不是,只以debug模式启动了TaierApplication

因为在后面版本更新以后我们将路径重写了 你这个应该是吧前端资源移动到你的data-develop的resources下了对吧?

在taier-data-develop/resource/static下面
图片

@Jixiangup
Copy link
Collaborator

Jixiangup commented Mar 18, 2024

你可以参考

public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/static/");
registry.addResourceHandler("/images/**").addResourceLocations("classpath:/static/images/");
registry.addResourceHandler("/assets/**").addResourceLocations("classpath:/static/assets/");
registry.addResourceHandler("swagger-ui.html").addResourceLocations(
"classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**").addResourceLocations(
"classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/taier/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
super.addResourceHandlers(registry);
}
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/taier/").setViewName("forward:/taier/index.html");
registry.addViewController("/").setViewName("forward:/taier/index.html");
}

同时 如果你把前端资源移动到data-develop以后 启动以后直接访问 $DATA-DEVELOP-HOST:$DATA-DEVELOP-PORT就可以访问到UI了

需要注意的是 这种方式每次前端改动都需要吧前端重新打包并且把前端资源内容dist文件移动到 data-develop 然后重启 data-develop

@Jixiangup Jixiangup self-assigned this Mar 18, 2024
@Jixiangup Jixiangup added the question Further information is requested label Mar 19, 2024
@Jixiangup
Copy link
Collaborator

如果还有问题请打开这个issue

@Jixiangup
Copy link
Collaborator

#260

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants