2017-09-27 2 views
0

"ng build"명령 줄을 사용하여 angular2 응용 프로그램을 빌드 한 후 "dist"파일의 내용을 서버에 추가했습니다 (FTP 클라이언트를 실행 함). "CMS". Angular2 - 배포 모드에서 라우팅이 중지되었습니다.

The server have website files.

I need to access my angular2 application when i calling the URL like this: http://thewebsiteurlintheserver.com/CMS

내가 마지막 (http://thewebsiteurlintheserver.com/CMS를) 할

난이 오류가있어 :

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'CMS' Error: Cannot match any routes. URL Segment: 'CMS'

+0

당신이 각 CLI 또는 index.html을에서 응용 프로그램의 basepath을 설정 않았다 index.html에 기본 HREF을 변경할 수 있습니다 –

+0

예 기본 "<기본 href ="/ ">" @ index.html에있는 @AniruddhaDas –

+0

기본 경로'/'에 있지 않은 디렉토리에 코드를 넣는 것처럼 기본 경로를''로 시도하십시오 –

답변

0

당신이 기본 HREF를 변경해야합니다. ~ <base href="/CMS/">

각도 cli를 사용하는 경우 ng build --prod --baseHref /CMS/ 명령을 사용할 수 있습니다. 당신은 각 CLI를 사용하지 않는 경우

, 당신은

+0

감사합니다 @ 종현 킨 –