How to fix routing for Angular 2 application using edgecast Azure CDN?

For my Angular app, here is the app.routing.ts file:

const appRoutes: Routes = [
    { path: '', component: LoginComponent },
    { path: 'dashboard', component: DashboardComponent },
    { path: 'application', component: ApplicationComponent },
    { path: 'decision', component: DecisionComponent },
];

export const routing = RouterModule.forRoot(appRoutes);

so on my local computer, when I do ng serve , I can go to the address bar in the browser and enter addresses such as:

local: 4200 / panel

local: 4200 / application

and it works great.

then I:

ng build --base-href /deploy/ --prod

and then copy the files from the dist folder on my local computer to the Azure Blob storage. I must have a blob container for files, and this container is called deploy . I get something like:

https://xxyz.blob.core.windows.net/deploy/favicon.ico
https://xxyz.blob.core.windows.net/deploy/index.html
https://xxyz.blob.core.windows.net/deploy/assets/Logo.svg
https://xxyz.blob.core.windows.net/deploy/main.68dbes8ef20.bundle.js
https://xxyz.blob.core.windows.net/deploy/styles.a2b9daa6d36.bundle.css

etc .. etc, and I can go to:

https://xxyz.blob.core.windows.net/deploy/favicon.ico

and see the icon

Then, on the Verizon Edgecast CDN, I can go to:

https://xxyz.com/deploy/index.html, .

https://xxyz.com/deploy/index.html CDN .

https://xxyz.com/login

, CDN:

https://xxyz.com/deploy/dashboard

https://xxyz.com/deploy/application

, CDN:

https://xxyz.com/login

https://xxyz.com/dashboard

https://xxyz.com/application

https://xxyz.com/

Im Verizon Premium Edgecast CDN, URL Rewrite, , , .

Angular? URL Azure CDN Edgecast?

, URL edgecast/Azure: enter image description here

, "":

IF:

CDN

Ip

cookie

Edge Cname

URL

URL

URL- URL-

URL-

URL- URL-

URL

URL

Regex URL

URL-

+4
1

" " "", "/deploy/" URL- CDN.

path to azure origin

90 . , , .

. 1: : Feature: URL Rewrite; : 'login'; : 'index.html' ( , ).

0

Source: https://habr.com/ru/post/1678192/


All Articles