Angular 7/8 響應開發服務器上的健康檢查 (Angular 7/8 respond to health-checks on the dev server)


問題描述

Angular 7/8 響應開發服務器上的健康檢查 (Angular 7/8 respond to health‑checks on the dev server)

我使用 ng serve 運行 Angular 開發服務器:

$ ng serve
10% building 3/3 modules 0 activeℹ 「wds」: Project is running at http://localhost:4200/webpack‑dev‑server/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: 404s will fallback to //index.html

chunk {main} main.js, main.js.map (main) 49.4 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 264 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 10.1 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 4.08 MB [initial] [rendered]
Date: 2019‑08‑27T19:37:48.511Z ‑ Hash: df1053ce80b7b0af763f ‑ Time: 8515ms
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
ℹ 「wdm」: Compiled successfully.

它在 EC2 實例上運行並偵聽端口 4200。我的負載均衡器正在 /,但由於某種原因,開發服務器在該路由上沒有響應 200?

有沒有辦法配置 Angular 開發服務器在某個路由上響應 200,它可能是/或其他路由?


參考解法

方法 1:

You are binding to localhost. Nothing external can reach your server. If you really want you can ng serve ‑‑host 0.0.0.0 but this is not a good idea. The dev server is not built to be secure.

(by user11810894Pace)

參考文件

  1. Angular 7/8 respond to health‑checks on the dev server (CC BY‑SA 2.5/3.0/4.0)

#angular7 #angular8 #aws-application-load-balancer #amazon-ec2 #Angular






相關問題

更改角度 7 中打印值的顏色 (Change the colour of printed value in angular 7)

在Angular7中更改路線的頁面重新加載問題 (Page reload issue on changing the route in Angular7)

如何使用訂閱來映射對象 (How to map object using subscribe in angular)

Angular 文件夾結構 (Angular Folder Structure)

在兄弟組件之間傳遞數據 (Passing Data between sibling components)

如何在 *ngFor 中循環選擇標籤並獲取所選值 (how to loop throught select tags inside *ngFor and get the selected value)

如何測試角度事件監聽器? (How to test angular event listeners?)

Angular 7/8 響應開發服務器上的健康檢查 (Angular 7/8 respond to health-checks on the dev server)

NgRx Store:如何在兩個功能模塊之間共享數據 (NgRx Store : How to share the data between two feature modules)

根據角度表單構建器/組中其他字段的值運行並設置一個字段的驗證錯誤 (Run and set the validation errors on one field based on the value of other field in angular form builder/group)

如何更改 Angular Material 中的標籤標籤? (How to change tab label in Angular Material?)

429 Too Many Requests - Angular 7 - 多個文件上傳 (429 Too Many Requests - Angular 7 - on multiple file upload)







留言討論