From eee45cff8d6f763d3260d6eee55dd3a945888db9 Mon Sep 17 00:00:00 2001 From: Meligy Date: Thu, 26 Jan 2017 21:43:48 +1100 Subject: [PATCH] feat(serve): add example of using custom base-href and proxy config The example added supports serving the app via http://localhost:4200/monitoring/ui/ Just run `nom start` to serve the app --- package.json | 3 ++- proxy.conf.json | 8 ++++++++ src/index.html | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 proxy.conf.json diff --git a/package.json b/package.json index e473358..f6abe21 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "ng": "ng", "reset": "ng init --routing --style=scss", - "start": "ng serve", + "start": "ng serve -open --proxy=proxy.conf.json", + "build": "ng build -bh \"/monitoring/ui/\"", "lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", diff --git a/proxy.conf.json b/proxy.conf.json new file mode 100644 index 0000000..9818066 --- /dev/null +++ b/proxy.conf.json @@ -0,0 +1,8 @@ +{ + "/monitoring/ui/**": { + "target": "http://localhost:4200/", + "pathRewrite": { + "^/monitoring/ui": "" + } + } +} diff --git a/src/index.html b/src/index.html index 1d994cc..b062b44 100644 --- a/src/index.html +++ b/src/index.html @@ -3,7 +3,7 @@ RoutingAngularCli - +