Angular中的问题(仅在生产模式下)

问题描述 投票:0回答:1

如果我在浏览器https://beeidea.com.br/中告知,它将毫无问题地重定向到https://beeidea.com.br/home 。 但是,如果我在地址栏中键入https://beeidea.com.br/home ,它将显示代码404

有任何想法吗?

angular typescript router
1个回答
1
投票

您需要在服务器上返回index.html文件。 就像是:

this.expressApp.get("/*", function (req, res, next) {
            return res.sendFile(clientFolder + '/index.html');
 }) 
© www.soinside.com 2019 - 2024. All rights reserved.