From 944185d8292f669f86c3073d05562d76c9c4568f Mon Sep 17 00:00:00 2001 From: garrettmills Date: Fri, 7 Feb 2020 21:19:16 -0600 Subject: [PATCH] Task #6 - create ionic proxy for local development --- .gitignore | 1 + angular.json | 3 ++- ionic.config.json | 3 ++- proxy.conf.json | 8 ++++++++ 4 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 proxy.conf.json diff --git a/.gitignore b/.gitignore index 416fc4c..1d333d8 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ npm-debug.log* /platforms /plugins /www +target-www** diff --git a/angular.json b/angular.json index 784b4bf..7a173c6 100644 --- a/angular.json +++ b/angular.json @@ -74,7 +74,8 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "app:build" + "browserTarget": "app:build", + "proxyConfig": "proxy.conf.json" }, "configurations": { "production": { diff --git a/ionic.config.json b/ionic.config.json index 3cad99c..eb22550 100644 --- a/ionic.config.json +++ b/ionic.config.json @@ -1,5 +1,6 @@ { "name": "frontend", "integrations": {}, - "type": "angular" + "type": "angular", + "proxy": "http://localhost:8000" } diff --git a/proxy.conf.json b/proxy.conf.json new file mode 100644 index 0000000..1e7fe81 --- /dev/null +++ b/proxy.conf.json @@ -0,0 +1,8 @@ +{ + "/link_api": { + "target": "http://localhost:8000", + "secure": false, + "logLevel": "debug", + "pathRewrite": {"^/link_api": ""} + } +}