I have finished a development of Angular 2 application and I need to deploy it. I need it to work standalone. So, I tried to move the content of dist folder inside a new apache website, but the routing mechanism doesn't work for some reason, I am getting 404 error when I try to go to /integrations route, for example. During the development, on angular 2 server, /integrations works and Angular 2 routing mechanism works and displays the component without problem. I need the standalone app to also be able to work with different URLs/paths. Any suggestions?
相关问题
- Angular RxJS mergeMap types
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Backbone.js PushState routes .htaccess only workin
- How to update placeholder text in ng2-smart-table?
- How to instantiate Http service in main.ts manuall
相关文章
- angular脚手架在ie9+下兼容问题
- angular 前端项目 build 报错 "Cannot find module 'le
- Angular Material Stepper causes mat-formfield to v
- After upgrade to Angular 9 cannot find variable in
- is there any difference between import { Observabl
- Suppress “Circular dependency detected” suppress w
- How can you get current positional information abo
- Angular material table not showing data
Follow following steps :
Step 1:
ng build --prod --env=prod
Step 2. (Copy dist into server) then dist folder created, copy dist folder and deploy it in root directory of server.
Step 3. Creates
.htaccess
file in root folder and paste this in the.htaccess
Yes you need to follow the angular 2 documentation deployment
It explain you how to fallback to index.html and give you an example with apache