我的角度应用程序托管在服务器中,该服务器的应用程序URL为http://xyz.domain.in(示例URL)。现在,我在其中创建了子目录来托管另一个应用程序。但是,当我尝试访问http://xyz.domain.in/subfolder之类的路径时,请在控制台中获取它。
错误:无法匹配任何路由。网址段:“子文件夹”
子文件夹中应用程序的基本href是
<base href="./subfolder">
如何做到这一点?
答案 0 :(得分:9)
启动构建时,必须指定子文件夹的路径:
ng build --base-href=/subfolder/
答案 1 :(得分:3)
不需要提及子文件夹的名称,如果要取消对子文件夹的限制,则只需提及href =“ ./”
答案 2 :(得分:0)
您需要像这样将 public class SensorModel
{
[Key]
public int ID { get; set; }
public ElectricalDataModel ElectricalData { get; set; }
}
public class ElectricalDataModel
{
public TensionModel Tension { get; set; }
public CurrentModel Current { get; set; }
public string SecurityClass { get; set; }
public ResistanceModel Resistance { get; set; }
public bool ReversePolarizationSecurity { get; set; }
}
public class TensionModel
{
public double Minimum { get; set; }
public double Maximum { get; set; }
public string Current { get; set; }
}
//.......................................... and so on
添加到您的路线中
pathMatch
答案 3 :(得分:0)
内置到子文件夹中:
ng build --prod --output-path="dist/subfolder" --deployUrl="subfolder/"