无法访问我的 api Express.js从 Angular6 运行在服务器上



我在Godaddy Host上的public_html目录中上传了我的Angular应用程序,在public_html/web-api中上传了api Express.js。关于主机中的节点,它工作正常,因为我用ssh运行它我有一个带有init db的控制台日志:img控制台ssh但当我收到API的请求时,ii看起来像angular不重定向。控制台ssh不会显示任何内容。在生产中,我需要在我的环境和proxy.conf中放入什么?在当地,我没有遇到任何问题。我需要写端口或我的APi所在的文件夹吗?

//enviroment.prod
export const environment = {
production: true, 
apiUrl: ['https://web.com'],
};

{
"/api/*": {
"target": "https://web.com/web-api",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
}
}

主机上的文件:public_html

目录:web api

感谢您的支持!!!

在本地我指定了api的端口:

//Proxy.conf.json
{
"/api/*": {
"target": "http://localhost:3000",
"secure": false,
"logLevel": "debug",
"changeOrigin": true
}
}

最新更新