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

编译运行时候提示资源不存在? #8

Closed
pt00ls opened this issue Jan 16, 2019 · 5 comments
Closed

编译运行时候提示资源不存在? #8

pt00ls opened this issue Jan 16, 2019 · 5 comments

Comments

@pt00ls
Copy link

pt00ls commented Jan 16, 2019

$ ./server -c ../../config/config.toml -m ../../config/model.conf
开始运行服务,服务版本号:1.2.0-dev
INFO[0000] 服务已运行在[test]模式下,运行版本:1.2.0-dev,进程号:8878 span_function= span_id=61b97f94-b06d-418e-8f1f-5882e8851c0e span_title= started_at="2019-01-16 10:47:40.631298875 +0800 CST m=+0.105783090" trace_id=cdb4c6b1-f010-4ca3-8d17-d721afe353ba user_id=
INFO[0000] HTTP服务开始启动,监听地址为:[127.0.0.1:8086] span_function= span_id=1b38453f-12c3-43cb-bd02-6d63b484a4cf span_title= started_at="2019-01-16 10:47:40.63526605 +0800 CST m=+0.109750342" trace_id=cdb4c6b1-f010-4ca3-8d17-d721afe353ba user_id=
WARN[0009] [请求错误] 资源不存在

@LyricTian
Copy link
Owner

LyricTian commented Jan 16, 2019

你这个错误是发生在运行之后,在浏览器里面访问地址的时候吧?这个时候只是api服务启动了,api服务只注册了/api开头的路由。你可以尝试访问/api/v1/demos?type=page。如果你想访问前端页面,你需要先使用npm run build编译前端项目,然后运行时使用参数-www指定前端编译后的目录(dist)就可以了。

@pt00ls
Copy link
Author

pt00ls commented Jan 16, 2019

您好,请问运行时使用参数-www指定前端编译后的dist目录,是指yarn运行指定吗,好像yarn没看到www参数?

@pt00ls
Copy link
Author

pt00ls commented Jan 16, 2019 via email

@LyricTian
Copy link
Owner

尝试执行命令:

./server -c ../../config/config.toml -m ../../config/model.conf -www ../../web/dist

@pt00ls
Copy link
Author

pt00ls commented Jan 16, 2019

非常感谢,成功解决了

@pt00ls pt00ls closed this as completed Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants