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

部署的问题 #28

Closed
heyiWF opened this issue Oct 20, 2020 · 4 comments
Closed

部署的问题 #28

heyiWF opened this issue Oct 20, 2020 · 4 comments

Comments

@heyiWF
Copy link

heyiWF commented Oct 20, 2020

image
image

网站部署成功了但是页面加载不出来,只有顶部一栏,请问这是因为API地址没有配置好吗?API也是在同一台服务器,地址要怎么填呢,需要带端口吗?

@qier222
Copy link
Owner

qier222 commented Oct 20, 2020

尝试下指定 NeteaseCloudMusicApi 的 HOST

HOST=127.0.0.1 node app.js  # Mac / Linux
set HOST=127.0.0.1 && node app.js # Windows

默认的 YesPlayMusic 地址为 http://127.0.0.1:8080

默认的网易云 API 地址为 http://127.0.0.1:3000

@heyiWF
Copy link
Author

heyiWF commented Oct 20, 2020

src/config/request.js 中的 baseURL 改为 http://127.0.0.1:3000 并以 HOST=127.0.0.1 node app.js 启动 NeteaseCloudMusicApi 后,从服务器端访问API和YesPlayMusic页面正常,但从外网无法访问 NeteaseCloudMusicApi,打开YesPlayMusic页面情况同上(只显示出顶栏)。
HOST=0.0.0.0 PORT=3000 node app.js 启动 NeteaseCloudMusicApi 后,从服务器端访问API和YesPlayMusic页面正常,从外网访问 NeteaseCloudMusicApi 正常,但从外网访问YesPlayMusic页面情况同上。

@qier222
Copy link
Owner

qier222 commented Oct 20, 2020

如果是部署到服务器上的话,建议使用域名+nginx反代API。

你也可以试试将HOST改成你的服务器IP。

@heyiWF
Copy link
Author

heyiWF commented Oct 20, 2020

解决了,不是改API的HOST,我把 request.js 里的地址改成服务器外网IP就可以了。感谢。界面美观实用,点赞!

@qier222 qier222 closed this as completed Oct 20, 2020
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